Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
labrobotica
algorithms
csm
Commits
a11a011a
Commit
a11a011a
authored
18 years ago
by
Andrea Censi
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
df0d3a6c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sm/lib/egsl/egsl.c
+9
-7
9 additions, 7 deletions
sm/lib/egsl/egsl.c
sm/lib/egsl/egsl.h
+2
-2
2 additions, 2 deletions
sm/lib/egsl/egsl.h
sm/lib/egsl/egsl_macros.h
+1
-1
1 addition, 1 deletion
sm/lib/egsl/egsl_macros.h
with
12 additions
and
10 deletions
sm/lib/egsl/egsl.c
+
9
−
7
View file @
a11a011a
...
...
@@ -78,9 +78,11 @@ void egsl_pop() {
assert
(
cid
>=
0
);
//, "No egsl_push before?");
egsl_contexts
[
cid
].
nvars
=
0
;
cid
--
;
if
(
cid
==
0
)
if
(
cid
==
0
)
{
printf
(
"egsl: total allocations: %d cache hits:%d
\n
"
,
egsl_total_allocations
,
egsl_cache_hits
);
printf
(
"egsl: sizeof(val) = %d
\n
"
,(
int
)
sizeof
(
val
));
}
}
val
egsl_alloc
(
size_t
rows
,
size_t
columns
)
{
...
...
@@ -91,14 +93,14 @@ val egsl_alloc(size_t rows, size_t columns) {
}
int
index
=
c
->
nvars
;
if
(
index
<
c
->
nallocated
)
{
if
(
c
->
vars
[
index
].
gsl_m
->
size1
==
rows
&&
c
->
vars
[
index
].
gsl_
m
->
size2
==
columns
)
{
egsl_cache_hits
++
;
c
->
nvars
++
;
return
assemble_val
(
cid
,
index
,
c
->
vars
[
index
].
gsl_m
);
gsl_matrix
*
m
=
c
->
vars
[
index
].
gsl_m
;
if
(
m
->
size1
==
rows
&&
m
->
size2
==
columns
)
{
egsl_cache_hits
++
;
c
->
nvars
++
;
return
assemble_val
(
cid
,
index
,
c
->
vars
[
index
].
gsl_m
);
}
else
{
egsl_total_allocations
++
;
gsl_matrix_free
(
c
->
vars
[
index
].
gsl_
m
);
gsl_matrix_free
(
m
);
c
->
vars
[
index
].
gsl_m
=
gsl_matrix_alloc
((
size_t
)
rows
,(
size_t
)
columns
);
c
->
nvars
++
;
return
assemble_val
(
cid
,
index
,
c
->
vars
[
index
].
gsl_m
);
...
...
This diff is collapsed.
Click to expand it.
sm/lib/egsl/egsl.h
+
2
−
2
View file @
a11a011a
...
...
@@ -5,9 +5,9 @@
#include
<gsl/gsl_matrix.h>
struct
egsl_val
{
int
cid
:
10
;
int
index
:
10
;
gsl_matrix
*
gslm
;
int
cid
:
16
;
int
index
:
16
;
};
typedef
struct
egsl_val
val
;
...
...
This diff is collapsed.
Click to expand it.
sm/lib/egsl/egsl_macros.h
+
1
−
1
View file @
a11a011a
...
...
@@ -27,4 +27,4 @@
#define inv(v) egsl_inverse(v)
#endif
\ No newline at end of file
#endif
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