Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CoMISo
CoMISo
Commits
94619e9b
Commit
94619e9b
authored
Dec 01, 2016
by
Max Lyon
Browse files
fix size_t int in examples
parent
2aa030be
Changes
5
Hide whitespace changes
Inline
Side-by-side
Examples/factored_solver/main.cc
View file @
94619e9b
...
...
@@ -67,11 +67,11 @@ void simple_constraint_row_matrix( MatrixT& _C, int _c, int _n, double _distribu
template
<
class
MatrixT
>
void
print_equations
(
const
MatrixT
&
_B
)
{
in
t
m
=
gmm
::
mat_nrows
(
_B
);
in
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
in
t
i
=
0
;
i
<
m
;
++
i
)
size_
t
m
=
gmm
::
mat_nrows
(
_B
);
size_
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
size_
t
i
=
0
;
i
<
m
;
++
i
)
{
for
(
in
t
j
=
0
;
j
<
n
-
1
;
++
j
)
for
(
size_
t
j
=
0
;
j
<
n
-
1
;
++
j
)
{
if
(
_B
(
i
,
j
)
!=
0.0
)
std
::
cout
<<
_B
(
i
,
j
)
<<
"*x"
<<
j
;
...
...
@@ -147,7 +147,7 @@ int main(void)
// this is the solution vector x
std
::
vector
<
double
>
x
;
in
t
new_n
=
gmm
::
mat_ncols
(
Bcol
);
size_
t
new_n
=
gmm
::
mat_ncols
(
Bcol
);
// set up B transposed
gmm
::
col_matrix
<
gmm
::
wsvector
<
double
>
>
Bt
(
new_n
,
m
);
gmm
::
copy
(
gmm
::
transposed
(
Bcol
),
Bt
);
...
...
Examples/quadratic_solver/main.cc
View file @
94619e9b
...
...
@@ -46,8 +46,8 @@ void random_sparse_row_matrix( MatrixT& _B, int _m, int _n, double _density = 0.
template
<
class
RMatrixT
,
class
CMatrixT
>
void
extract_Axb
(
const
RMatrixT
&
_B
,
CMatrixT
&
_A
,
std
::
vector
<
double
>&
_b
)
{
in
t
dimm
=
gmm
::
mat_nrows
(
_B
);
in
t
dimn
=
gmm
::
mat_ncols
(
_B
);
size_
t
dimm
=
gmm
::
mat_nrows
(
_B
);
size_
t
dimn
=
gmm
::
mat_ncols
(
_B
);
gmm
::
col_matrix
<
gmm
::
wsvector
<
double
>
>
Btcol
;
gmm
::
col_matrix
<
gmm
::
wsvector
<
double
>
>
Bcol
;
gmm
::
resize
(
Btcol
,
dimn
,
dimm
);
...
...
@@ -86,11 +86,11 @@ void simple_constraint_row_matrix( MatrixT& _C, int _c, int _n, double _distribu
template
<
class
MatrixT
>
void
print_equations
(
const
MatrixT
&
_B
)
{
in
t
m
=
gmm
::
mat_nrows
(
_B
);
in
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
in
t
i
=
0
;
i
<
m
;
++
i
)
size_
t
m
=
gmm
::
mat_nrows
(
_B
);
size_
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
size_
t
i
=
0
;
i
<
m
;
++
i
)
{
for
(
in
t
j
=
0
;
j
<
n
-
1
;
++
j
)
for
(
size_
t
j
=
0
;
j
<
n
-
1
;
++
j
)
{
if
(
_B
(
i
,
j
)
!=
0.0
)
std
::
cout
<<
_B
(
i
,
j
)
<<
"*x"
<<
j
;
...
...
Examples/small_factored_example/main.cc
View file @
94619e9b
...
...
@@ -46,11 +46,11 @@ void init_fac( MatrixT& _B )
template
<
class
MatrixT
>
void
print_equations
(
const
MatrixT
&
_B
)
{
in
t
m
=
gmm
::
mat_nrows
(
_B
);
in
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
in
t
i
=
0
;
i
<
m
;
++
i
)
size_
t
m
=
gmm
::
mat_nrows
(
_B
);
size_
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
size_
t
i
=
0
;
i
<
m
;
++
i
)
{
for
(
in
t
j
=
0
;
j
<
n
-
1
;
++
j
)
for
(
size_
t
j
=
0
;
j
<
n
-
1
;
++
j
)
{
if
(
_B
(
i
,
j
)
!=
0.0
)
std
::
cout
<<
_B
(
i
,
j
)
<<
"*x"
<<
j
;
...
...
Examples/small_quadratic_example/main.cc
View file @
94619e9b
...
...
@@ -48,11 +48,11 @@ void init_les( MatrixT& _A, std::vector< double >& _b)
template
<
class
MatrixT
>
void
print_equations
(
const
MatrixT
&
_B
)
{
in
t
m
=
gmm
::
mat_nrows
(
_B
);
in
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
in
t
i
=
0
;
i
<
m
;
++
i
)
size_
t
m
=
gmm
::
mat_nrows
(
_B
);
size_
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
size_
t
i
=
0
;
i
<
m
;
++
i
)
{
for
(
in
t
j
=
0
;
j
<
n
-
1
;
++
j
)
for
(
size_
t
j
=
0
;
j
<
n
-
1
;
++
j
)
{
if
(
_B
(
i
,
j
)
!=
0.0
)
std
::
cout
<<
_B
(
i
,
j
)
<<
"*x"
<<
j
;
...
...
Examples/small_quadratic_resolve_example/main.cc
View file @
94619e9b
...
...
@@ -48,11 +48,11 @@ void init_les( MatrixT& _A, std::vector< double >& _b)
template
<
class
MatrixT
>
void
print_equations
(
const
MatrixT
&
_B
)
{
in
t
m
=
gmm
::
mat_nrows
(
_B
);
in
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
in
t
i
=
0
;
i
<
m
;
++
i
)
size_
t
m
=
gmm
::
mat_nrows
(
_B
);
size_
t
n
=
gmm
::
mat_ncols
(
_B
);
for
(
size_
t
i
=
0
;
i
<
m
;
++
i
)
{
for
(
in
t
j
=
0
;
j
<
n
-
1
;
++
j
)
for
(
size_
t
j
=
0
;
j
<
n
-
1
;
++
j
)
{
if
(
_B
(
i
,
j
)
!=
0.0
)
std
::
cout
<<
_B
(
i
,
j
)
<<
"*x"
<<
j
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment