Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
aa5959b2
Commit
aa5959b2
authored
13 years ago
by
Nicolas Marsic
Browse files
Options
Downloads
Patches
Plain Diff
Remove old Matrix depencies
parent
1ac41de9
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
FunctionSpace/CMakeLists.txt
+1
-2
1 addition, 2 deletions
FunctionSpace/CMakeLists.txt
FunctionSpace/Matrix.cpp
+0
-67
0 additions, 67 deletions
FunctionSpace/Matrix.cpp
FunctionSpace/Matrix.h
+0
-131
0 additions, 131 deletions
FunctionSpace/Matrix.h
with
1 addition
and
200 deletions
FunctionSpace/CMakeLists.txt
+
1
−
2
View file @
aa5959b2
...
...
@@ -4,7 +4,6 @@
# bugs and problems to <gmsh@geuz.org>.
set
(
SRC
Matrix.cpp
VectorDouble.cpp
VectorPolynomial.cpp
Polynomial.cpp
...
...
@@ -23,5 +22,5 @@ set(SRC
file
(
GLOB HDR RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.h
)
append_gmsh_src
(
FunctionSpace
"
${
SRC
}
;
${
HDR
}
"
)
## Compatibility with SmallFEM (TO BE REMOVED !!!)
## Compatibility wi
c
th SmallFEM (TO BE REMOVED !!!)
add_sources_in_gmsh
(
FunctionSpace
"
${
SRC
}
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
FunctionSpace/Matrix.cpp
deleted
100644 → 0
+
0
−
67
View file @
1ac41de9
#include
<sstream>
#include
"Matrix.h"
#include
"Exception.h"
extern
"C"
{
#include
<cblas.h>
}
Matrix
::
Matrix
(
const
int
n
,
const
int
m
){
if
(
!
(
n
||
m
))
throw
Exception
(
"Matrix can't be of dimension (0, 0)"
);
nRow
=
n
;
nCol
=
m
;
nElem
=
nRow
*
nCol
;
matrix
=
new
double
[
nElem
];
}
Matrix
::~
Matrix
(
void
){
if
(
matrix
)
delete
[]
matrix
;
}
void
Matrix
::
allToZero
(
void
){
for
(
int
i
=
0
;
i
<
nElem
;
i
++
)
matrix
[
i
]
=
0.0
;
}
Vector
<
double
>
Matrix
::
mult
(
const
Vector
<
double
>&
v
)
const
{
Vector
<
double
>
s
(
v
.
N
);
cblas_dgemv
(
CblasRowMajor
,
CblasNoTrans
,
nRow
,
nCol
,
1.0
,
matrix
,
nCol
,
v
.
v
,
1
,
0.0
,
s
.
v
,
1
);
return
s
;
}
std
::
string
Matrix
::
toString
(
void
)
const
{
std
::
stringstream
s
;
for
(
int
i
=
0
;
i
<
nRow
;
i
++
){
for
(
int
j
=
0
;
j
<
nCol
;
j
++
){
s
<<
std
::
scientific
<<
std
::
showpos
<<
get
(
i
,
j
)
<<
"
\t
"
;
}
s
<<
std
::
endl
;
}
return
s
.
str
();
}
std
::
string
Matrix
::
toStringMatlab
(
void
)
const
{
std
::
stringstream
s
;
s
<<
"["
;
for
(
int
i
=
0
;
i
<
nRow
;
i
++
){
for
(
int
j
=
0
;
j
<
nCol
;
j
++
){
s
<<
std
::
scientific
<<
std
::
showpos
<<
get
(
j
,
i
)
<<
" "
;
}
s
<<
";"
;
}
s
<<
"]"
;
return
s
.
str
();
}
This diff is collapsed.
Click to expand it.
FunctionSpace/Matrix.h
deleted
100644 → 0
+
0
−
131
View file @
1ac41de9
#ifndef _MATRIX_H_
#define _MATRIX_H_
#include
<string>
#include
"Vector.h"
/**
@class Matrix
@brief Handles matrices
This class represents a @c n by @c m matrix.
@todo
Other than Matrix of double
*/
class
Solver
;
class
Matrix
{
private:
int
nRow
;
int
nCol
;
int
nElem
;
double
*
matrix
;
friend
class
Solver
;
public:
Matrix
(
const
int
n
,
const
int
m
);
~
Matrix
(
void
);
int
row
(
void
)
const
;
int
col
(
void
)
const
;
void
set
(
const
int
i
,
const
int
j
,
const
double
v
);
void
allToZero
(
void
);
double
get
(
const
int
i
,
const
int
j
)
const
;
double
&
operator
()(
const
int
i
,
const
int
j
);
double
operator
()(
const
int
i
,
const
int
j
)
const
;
Vector
<
double
>
mult
(
const
Vector
<
double
>&
v
)
const
;
std
::
string
toString
(
void
)
const
;
std
::
string
toStringMatlab
(
void
)
const
;
};
/**
@fn Matrix::Matrix
@param n The number of @em rows of the future Matrix
@param m The number of @em columns of the future Matrix
@return Returns a new @c n by @c m Matrix
@fn Matrix::~Matrix
@return Deletes this Matrix
@fn Matrix::row
@return Returns the number of @c rows of this Matrix
@fn Matrix::col
@return Returns the number of @c columns of this Matrix
@fn Matrix::set
@param i A @em row index
@param j A @em column index
@param v A value
@returns Sets the given value at the position (@c i, @c j)
in this Matrix
@fn Matrix::allToZero
@returns Sets all the Matrix elements to @em @c 0
@fn Matrix::get
@param i A @em row index
@param j A @em column index
@returns Retuns the value at the position (@c i, @c j)
in this Matrix
@fn double& Matrix::operator()(const int, const int)
@param i A @em row index
@param j A @em column index
@return Returns a @em reference to the element
at position (@c i, @c j) in this Matrix
@fn double Matrix::operator()(const int, const int) const
@param i A @em row index
@param j A @em column index
@return Returns the @em value of the element
at position (@c i, @c j) in this Matrix
@fn Matrix::mult
@param v A Vector of size @c m (for a @c n by @c m Matrix)
@return Returns the Vector (of size @c n) resulting
of the product of @em this Matrix with the @em given Vector
@fn Matrix::toString
@return Retuns a string correspondig to this Matrix
@fn Matrix::toStringMatlab
@return Same as Matrix::toString, but the string is in
Matlab / Octave format
*/
//////////////////////
// Inline Functions //
//////////////////////
inline
int
Matrix
::
row
(
void
)
const
{
return
nRow
;
}
inline
int
Matrix
::
col
(
void
)
const
{
return
nCol
;
}
inline
void
Matrix
::
set
(
const
int
i
,
const
int
j
,
const
double
v
){
matrix
[
j
+
i
*
nCol
]
=
v
;
}
inline
double
Matrix
::
get
(
const
int
i
,
const
int
j
)
const
{
return
matrix
[
j
+
i
*
nCol
];
}
inline
double
&
Matrix
::
operator
()(
const
int
i
,
const
int
j
){
return
matrix
[
j
+
i
*
nCol
];
}
inline
double
Matrix
::
operator
()(
const
int
i
,
const
int
j
)
const
{
return
matrix
[
j
+
i
*
nCol
];
}
#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