NanoStructures
1.0
DMFT solver for layered, strongly correlated nanostructures
Main Page
Related Pages
Modules
Classes
Files
File List
math
matrix.h
1
#ifndef MATRIX_H
2
#define MATRIX_H
3
4
#include <string.h>
5
6
namespace
math {
7
class
Matrix
8
{
9
public
:
10
Matrix
();
11
Matrix
(
int
rows,
int
cols);
12
Matrix
(
const
Matrix
& orig);
13
Matrix
& operator=(
const
Matrix
& orig);
14
15
inline
int
getColumns()
const
{
return
m_columns; }
16
inline
int
getRows()
const
{
return
m_rows; }
17
inline
double
* getData() {
return
m_data; }
18
19
double
get
(
int
row,
int
column)
const
;
20
void
set(
int
row,
int
column,
double
value);
21
22
void
resize(
int
rows,
int
columns);
23
24
//convenience
25
void
zero() { memset(m_data, 0,
sizeof
(
double
) * m_rows * m_columns); }
26
27
void
copy(
Matrix
& source,
int
offset_rows,
int
offset_cols,
int
size_rows,
int
size_columns,
double
prefactor);
28
Matrix
* crop(
int
offsetm_rows,
int
offsetm_cols,
int
sizem_rows,
int
sizem_cols);
29
30
31
~
Matrix
();
32
protected
:
33
double
* m_data;
34
int
m_rows;
35
int
m_columns;
36
37
//testing
38
// FRIEND_TEST(MatrixTest, DefaultConstructor);
39
// FRIEND_TEST(MatrixTest, CopyConstructor);
40
41
};
42
}
43
44
#endif // MATRIX_H
math::Matrix
Definition:
matrix.h:7
Generated on Sat Jun 28 2014 11:55:18 for NanoStructures by
1.8.6