Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
028699e0
Commit
028699e0
authored
8 years ago
by
dawehr
Browse files
Options
Downloads
Patches
Plain Diff
Fixed last line endings?
parent
57b3adb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
quad/computation_graph/src/node_pow.c
+26
-26
26 additions, 26 deletions
quad/computation_graph/src/node_pow.c
with
26 additions
and
26 deletions
quad/computation_graph/src/node_pow.c
+
26
−
26
View file @
028699e0
#include
"node_pow.h"
#include
<stdlib.h>
#include
<math.h>
static
void
pow_nodes
(
void
*
state
,
const
double
*
params
,
const
double
*
inputs
,
double
*
outputs
)
{
outputs
[
POW_RESULT
]
=
pow
(
inputs
[
POW_BASE
],
params
[
POW_EXP
]);
}
static
void
reset
(
void
*
state
)
{}
static
const
char
*
const
in_names
[
1
]
=
{
"Base"
};
static
const
char
*
const
out_names
[
1
]
=
{
"Result"
};
static
const
char
*
const
param_names
[
1
]
=
{
"Exponent"
};
const
struct
graph_node_type
node_pow_type
=
{
.
input_names
=
in_names
,
.
output_names
=
out_names
,
.
param_names
=
param_names
,
.
n_inputs
=
1
,
.
n_outputs
=
1
,
.
n_params
=
1
,
.
execute
=
pow_nodes
,
.
reset
=
reset
};
int
graph_add_node_pow
(
struct
computation_graph
*
graph
,
const
char
*
name
)
{
return
graph_add_node
(
graph
,
name
,
&
node_pow_type
,
NULL
);
}
#include
"node_pow.h"
#include
<stdlib.h>
#include
<math.h>
static
void
pow_nodes
(
void
*
state
,
const
double
*
params
,
const
double
*
inputs
,
double
*
outputs
)
{
outputs
[
POW_RESULT
]
=
pow
(
inputs
[
POW_BASE
],
params
[
POW_EXP
]);
}
static
void
reset
(
void
*
state
)
{}
static
const
char
*
const
in_names
[
1
]
=
{
"Base"
};
static
const
char
*
const
out_names
[
1
]
=
{
"Result"
};
static
const
char
*
const
param_names
[
1
]
=
{
"Exponent"
};
const
struct
graph_node_type
node_pow_type
=
{
.
input_names
=
in_names
,
.
output_names
=
out_names
,
.
param_names
=
param_names
,
.
n_inputs
=
1
,
.
n_outputs
=
1
,
.
n_params
=
1
,
.
execute
=
pow_nodes
,
.
reset
=
reset
};
int
graph_add_node_pow
(
struct
computation_graph
*
graph
,
const
char
*
name
)
{
return
graph_add_node
(
graph
,
name
,
&
node_pow_type
,
NULL
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment