Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miscmaths
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
FSL
miscmaths
Commits
7c5872a0
Commit
7c5872a0
authored
15 years ago
by
Jesper Andersson
Browse files
Options
Downloads
Patches
Plain Diff
Default behaviour is now that warnings are turned off
parent
7fdf2c85
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SpMat.h
+9
-6
9 additions, 6 deletions
SpMat.h
with
9 additions
and
6 deletions
SpMat.h
+
9
−
6
View file @
7c5872a0
...
@@ -89,8 +89,8 @@ template<class T>
...
@@ -89,8 +89,8 @@ template<class T>
class
SpMat
class
SpMat
{
{
public:
public:
SpMat
()
:
_m
(
0
),
_n
(
0
),
_nz
(
0
),
_ri
(
0
),
_val
(
0
)
{}
SpMat
()
:
_m
(
0
),
_n
(
0
),
_nz
(
0
),
_ri
(
0
),
_val
(
0
)
,
_pw
(
false
)
{}
SpMat
(
unsigned
int
m
,
unsigned
int
n
)
:
_m
(
m
),
_n
(
n
),
_nz
(
0
),
_ri
(
n
),
_val
(
n
)
{}
SpMat
(
unsigned
int
m
,
unsigned
int
n
)
:
_m
(
m
),
_n
(
n
),
_nz
(
0
),
_ri
(
n
),
_val
(
n
)
,
_pw
(
false
)
{}
SpMat
(
unsigned
int
m
,
unsigned
int
n
,
const
unsigned
int
*
irp
,
const
unsigned
int
*
jcp
,
const
double
*
sp
);
SpMat
(
unsigned
int
m
,
unsigned
int
n
,
const
unsigned
int
*
irp
,
const
unsigned
int
*
jcp
,
const
double
*
sp
);
SpMat
(
const
NEWMAT
::
GeneralMatrix
&
M
);
SpMat
(
const
NEWMAT
::
GeneralMatrix
&
M
);
SpMat
(
const
std
::
string
&
fname
);
SpMat
(
const
std
::
string
&
fname
);
...
@@ -109,6 +109,8 @@ public:
...
@@ -109,6 +109,8 @@ public:
void
Print
(
const
std
::
string
&
fname
)
const
{
Print
(
fname
,
8
);}
void
Print
(
const
std
::
string
&
fname
)
const
{
Print
(
fname
,
8
);}
void
Print
(
unsigned
int
precision
)
const
{
Print
(
std
::
string
(
""
),
precision
);}
void
Print
(
unsigned
int
precision
)
const
{
Print
(
std
::
string
(
""
),
precision
);}
void
Print
()
const
{
Print
(
8
);}
void
Print
()
const
{
Print
(
8
);}
void
WarningsOn
()
{
_pw
=
true
;}
void
WarningsOff
()
{
_pw
=
false
;}
T
Peek
(
unsigned
int
r
,
unsigned
int
c
)
const
;
T
Peek
(
unsigned
int
r
,
unsigned
int
c
)
const
;
...
@@ -173,6 +175,7 @@ private:
...
@@ -173,6 +175,7 @@ private:
unsigned
long
_nz
;
unsigned
long
_nz
;
std
::
vector
<
std
::
vector
<
unsigned
int
>
>
_ri
;
std
::
vector
<
std
::
vector
<
unsigned
int
>
>
_ri
;
std
::
vector
<
std
::
vector
<
T
>
>
_val
;
std
::
vector
<
std
::
vector
<
T
>
>
_val
;
bool
_pw
;
// Print Warnings
bool
found
(
const
std
::
vector
<
unsigned
int
>&
ri
,
unsigned
int
key
,
int
&
pos
)
const
;
bool
found
(
const
std
::
vector
<
unsigned
int
>&
ri
,
unsigned
int
key
,
int
&
pos
)
const
;
T
&
here
(
unsigned
int
r
,
unsigned
int
c
);
T
&
here
(
unsigned
int
r
,
unsigned
int
c
);
...
@@ -305,7 +308,7 @@ private:
...
@@ -305,7 +308,7 @@ private:
template
<
class
T
>
template
<
class
T
>
SpMat
<
T
>::
SpMat
(
unsigned
int
m
,
unsigned
int
n
,
const
unsigned
int
*
irp
,
const
unsigned
int
*
jcp
,
const
double
*
sp
)
SpMat
<
T
>::
SpMat
(
unsigned
int
m
,
unsigned
int
n
,
const
unsigned
int
*
irp
,
const
unsigned
int
*
jcp
,
const
double
*
sp
)
:
_m
(
m
),
_n
(
n
),
_nz
(
0
),
_ri
(
n
),
_val
(
n
)
:
_m
(
m
),
_n
(
n
),
_nz
(
0
),
_ri
(
n
),
_val
(
n
)
,
_pw
(
false
)
{
{
_nz
=
jcp
[
n
];
_nz
=
jcp
[
n
];
unsigned
long
nz
=
0
;
unsigned
long
nz
=
0
;
...
@@ -335,7 +338,7 @@ SpMat<T>::SpMat(unsigned int m, unsigned int n, const unsigned int *irp, const u
...
@@ -335,7 +338,7 @@ SpMat<T>::SpMat(unsigned int m, unsigned int n, const unsigned int *irp, const u
template
<
class
T
>
template
<
class
T
>
SpMat
<
T
>::
SpMat
(
const
NEWMAT
::
GeneralMatrix
&
M
)
SpMat
<
T
>::
SpMat
(
const
NEWMAT
::
GeneralMatrix
&
M
)
:
_m
(
M
.
Nrows
()),
_n
(
M
.
Ncols
()),
_nz
(
0
),
_ri
(
M
.
Ncols
()),
_val
(
M
.
Ncols
())
:
_m
(
M
.
Nrows
()),
_n
(
M
.
Ncols
()),
_nz
(
0
),
_ri
(
M
.
Ncols
()),
_val
(
M
.
Ncols
())
,
_pw
(
false
)
{
{
double
*
m
=
static_cast
<
double
*>
(
M
.
Store
());
double
*
m
=
static_cast
<
double
*>
(
M
.
Store
());
...
@@ -371,7 +374,7 @@ SpMat<T>::SpMat(const NEWMAT::GeneralMatrix& M)
...
@@ -371,7 +374,7 @@ SpMat<T>::SpMat(const NEWMAT::GeneralMatrix& M)
template
<
class
T
>
template
<
class
T
>
SpMat
<
T
>::
SpMat
(
const
std
::
string
&
fname
)
SpMat
<
T
>::
SpMat
(
const
std
::
string
&
fname
)
:
_m
(
0
),
_n
(
0
),
_nz
(
0
),
_ri
(
0
),
_val
(
0
)
:
_m
(
0
),
_n
(
0
),
_nz
(
0
),
_ri
(
0
),
_val
(
0
)
,
_pw
(
false
)
{
{
// First read data into (nz+1)x3 NEWMAT matrix
// First read data into (nz+1)x3 NEWMAT matrix
NEWMAT
::
Matrix
rcv
;
NEWMAT
::
Matrix
rcv
;
...
@@ -573,7 +576,7 @@ NEWMAT::ReturnMatrix SpMat<T>::SolveForx(const NEWMAT::ColumnVector&
...
@@ -573,7 +576,7 @@ NEWMAT::ReturnMatrix SpMat<T>::SolveForx(const NEWMAT::ColumnVector&
throw
SpMatException
(
"SolveForx: No idea how you got here. But you shouldn't be here, punk."
);
throw
SpMatException
(
"SolveForx: No idea how you got here. But you shouldn't be here, punk."
);
}
}
if
(
status
)
{
if
(
status
&&
_pw
)
{
cout
<<
"SpMat::SolveForx: Warning requested tolerence not obtained."
<<
endl
;
cout
<<
"SpMat::SolveForx: Warning requested tolerence not obtained."
<<
endl
;
cout
<<
"Requested tolerance was "
<<
ltol
<<
", and achieved tolerance was "
<<
tol
<<
endl
;
cout
<<
"Requested tolerance was "
<<
ltol
<<
", and achieved tolerance was "
<<
tol
<<
endl
;
cout
<<
"This may or may not be a problem in your application, but you should look into it"
<<
endl
;
cout
<<
"This may or may not be a problem in your application, but you should look into it"
<<
endl
;
...
...
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