Code:
int size = some_number;
A = new double *[size+1];
for(int i=1;i<=size; i++){
A[i] = new double [size+1];
}
It seems that the answer to my question depends...
int size = some_number;
A = new double *[size+1];
for(int i=1;i<=size; i++){
A[i] = new double [size+1];
}
int Nsteps, Npos; double dz; // arrays to hold the field values double *x_old; double *x_new;
class class_name{
public:
class_name(); // Constructor
// Member functions
void function_1();
void function_2(double *mat);
void function_3();
void function_2_re_def(double *mat);
void function_3_re_def();
public:
int rows;
int cols;
double *v1;
void read_data(char *file,int &ndata,double *x,double *y)
{
//Read the data from the file and store it in memory
//This reads the data stored in the two column file and stores it in memory
char *overlapfile; overlapfile=(char *)(f1.c_str());
int file;
errno_t err=_sopen_s(&file,overlapfile,_O_BINARY,_SH_DENYNO,_S_IREAD);
if(file==-1){
perror("Failed to open file");
}
else{
//Import data
}
const char *
string drive="c:\\" string dir1="Output_Files\\"; string dir2="Calculation_Data\\";
pos=(int)(strcspn(buf,","));
posa=(int)(strcspn(buf,",")); posb=(int)(strcspn(buf,"\n")); pos=Min(posa,posb); // Min is a template function that returns the minimum of posa and posb
ifstream data; data.open(file,ios_base::in);
int buf_size=1024*1024*10; char *BUF=new(char[buf_size]);
//header file
class froot{
public:
void calculate_root(int i);
double F(double x);
double G(double x);
double find_root(double (*g)(double),double x1,double x2,int &depth);
double root(double x1,double x2,double (*g)(double),double f1,double f2,int &depth);
private:
#define PI 3.1415926535897932385
#define PI 4.0*atan(1.0)
Leave a comment: