-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZeros.cpp
executable file
·39 lines (35 loc) · 915 Bytes
/
Zeros.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/////////////////////////////////////////////////////////////////////////
// Program : zeros.cpp
// Coded by : Prof. Gang-Gyoo Jin, Korea Maritime University
// Coded on : 12/12/2003
#include "imsl.h"
#include "cmatrix.h"
/////////////////////////////////////////////////////////////////////////
// Generates a REAL zeros matrix
RMATRIX ms_Zeros(int n, int m)
{
if(m!=0)
{
RMATRIX a(n,m);
for (int i=0;i<a.num;i++) a(i)=0;
return a;
}
else
{
RMATRIX a(n,n);
for (int i=0;i<a.num;i++) a(i)=0;
return a;
}
}
/////////////////////////////////////////////////////////////////////////
// Generates a REAL zeros matrix
void ms_Zeros(RMATRIX &a)
{
for (int i=0;i<a.num;i++) a(i)=0;
}
/////////////////////////////////////////////////////////////////////////
// Generates a COMPLEX zeros matrix
void ms_Zeros(CMATRIX &a)
{
for(int i=0;i<a.num;i++) a(i)=0;
}