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
25cbde12
Commit
25cbde12
authored
18 years ago
by
Mark Jenkinson
Browse files
Options
Downloads
Patches
Plain Diff
Reverted to branch version
parent
39b47001
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
miscmaths.h
+15
-18
15 additions, 18 deletions
miscmaths.h
with
15 additions
and
18 deletions
miscmaths.h
+
15
−
18
View file @
25cbde12
...
...
@@ -15,7 +15,6 @@
#define __miscmaths_h
#include
<cmath>
#include
<cstdlib>
#include
<vector>
#include
<iostream>
#include
<assert.h>
...
...
@@ -23,17 +22,15 @@
#include
<sstream>
#include
<string>
#include
<iterator>
#include
"fslio/fslio.h"
#include
"config.h"
#include
"newmatap.h"
#include
"kernel.h"
//#pragma interface
using
namespace
NEWMAT
;
//
using namespace std;
using
namespace
std
;
namespace
MISCMATHS
{
...
...
@@ -41,13 +38,11 @@ namespace MISCMATHS {
#define M_PI 3.14159265358979323846
#endif
#define OUT(t) cout<<#t "="<<t<<endl;
// IO/string stuff
template
<
class
T
>
string
num2str
(
T
n
,
int
width
=-
1
);
#if defined(_MSC_VER) && (_MSC_VER < 1300)
template
<
class
T
>
string
num2str
(
T
n
)
{
return
num2str
(
n
-
1
);
}
#endif
string
size
(
const
Matrix
&
mat
);
bool
isnum
(
const
string
&
str
);
ReturnMatrix
read_ascii_matrix
(
const
string
&
filename
,
int
nrows
,
int
ncols
);
...
...
@@ -65,14 +60,14 @@ namespace MISCMATHS {
int
write_binary_matrix
(
const
Matrix
&
mat
,
const
string
&
filename
);
// more basic IO calls
string
skip_alpha
(
std
::
ifstream
&
fs
);
ReturnMatrix
read_ascii_matrix
(
std
::
ifstream
&
fs
,
int
nrows
,
int
ncols
);
ReturnMatrix
read_ascii_matrix
(
int
nrows
,
int
ncols
,
std
::
ifstream
&
fs
);
ReturnMatrix
read_ascii_matrix
(
std
::
ifstream
&
fs
);
ReturnMatrix
read_binary_matrix
(
std
::
ifstream
&
fs
);
int
write_ascii_matrix
(
const
Matrix
&
mat
,
std
::
ofstream
&
fs
,
int
precision
=-
1
);
int
write_ascii_matrix
(
std
::
ofstream
&
fs
,
const
Matrix
&
mat
,
int
precision
=-
1
);
int
write_binary_matrix
(
const
Matrix
&
mat
,
std
::
ofstream
&
fs
);
string
skip_alpha
(
ifstream
&
fs
);
ReturnMatrix
read_ascii_matrix
(
ifstream
&
fs
,
int
nrows
,
int
ncols
);
ReturnMatrix
read_ascii_matrix
(
int
nrows
,
int
ncols
,
ifstream
&
fs
);
ReturnMatrix
read_ascii_matrix
(
ifstream
&
fs
);
ReturnMatrix
read_binary_matrix
(
ifstream
&
fs
);
int
write_ascii_matrix
(
const
Matrix
&
mat
,
ofstream
&
fs
,
int
precision
=-
1
);
int
write_ascii_matrix
(
ofstream
&
fs
,
const
Matrix
&
mat
,
int
precision
=-
1
);
int
write_binary_matrix
(
const
Matrix
&
mat
,
ofstream
&
fs
);
// General maths
...
...
@@ -159,6 +154,9 @@ namespace MISCMATHS {
float
rms_deviation
(
const
Matrix
&
affmat1
,
const
Matrix
&
affmat2
,
const
float
rmax
=
80.0
);
Matrix
Mat44ToNewmat
(
mat44
m
);
mat44
NewmatToMat44
(
const
Matrix
&
m
);
void
get_axis_orientations
(
const
Matrix
&
sform_mat
,
int
sform_code
,
const
Matrix
&
qform_mat
,
int
qform_code
,
int
&
icode
,
int
&
jcode
,
int
&
kcode
);
...
...
@@ -200,8 +198,7 @@ namespace MISCMATHS {
ReturnMatrix
min
(
const
Matrix
&
mat
);
ReturnMatrix
gt
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
lt
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
geqt
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
geqt
(
const
Matrix
&
mat1
,
const
float
a
);
ReturnMatrix
geqt
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
leqt
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
eq
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
neq
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
...
...
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