Make changes

This commit is contained in:
Cory Balaton 2023-09-11 10:40:57 +02:00
parent 54f5d4ab5d
commit 0a9e484ed3
No known key found for this signature in database
GPG Key ID: 3E5FCEBFD80F432B
3 changed files with 12 additions and 10 deletions

View File

@ -1,19 +1,21 @@
CC=g++
OBJS= generalAlgorithm.o specialAlgorithm.o
CCFLAGS= -std=c++11
OBJS=generalAlgorithm.o specialAlgorithm.o
.PHONY: clean
all: main analyticPlot
main: main.o $(OBJS)
$(CC) -o $@ $^
$(CC) $(CCFLAGS) -o $@ $^
analyticPlot: analyticPlot.o
$(CC) -o $@ $^
$(CC) $(CCFLAGS) -o $@ $^
%.o: %.cpp
$(CC) -c -o $@ $^
$(CC) $(CCFLAGS) -c -o $@ $^
clean:
rm *.o

View File

@ -50,11 +50,11 @@ void general_algorithm_main()
v_vec = general_algorithm(&sub_diag, &main_diag, &sup_diag, &g_vec);
ofile.open("general_algorithm_" + std::to_string(steps) + ".txt");
ofile.open("output/general_algorithm_" + std::to_string(steps) + ".txt");
for (int j=0; j < v_vec->n_elem; j++) {
ofile << std::setprecision(4) << std::scientific << step_size*(i+1) << ","
<< std::setprecision(4) << std::scientific << (*v_vec)(i) << std::endl;
ofile << std::setprecision(4) << std::scientific << step_size*(j+1) << ","
<< std::setprecision(4) << std::scientific << (*v_vec)(j) << std::endl;
}
ofile.close();
}

View File

@ -40,11 +40,11 @@ void special_algorithm_main()
v_vec = special_algorithm(sub_sig, main_sig, sup_sig, &g_vec);
ofile.open("special_algorithm_" + std::to_string(steps) + ".txt");
ofile.open("output/special_algorithm_" + std::to_string(steps) + ".txt");
for (int j=0; j < v_vec->n_elem; j++) {
ofile << std::setprecision(4) << std::scientific << step_size*(i+1) << ","
<< std::setprecision(4) << std::scientific << (*v_vec)(i) << std::endl;
ofile << std::setprecision(4) << std::scientific << step_size*(j+1) << ","
<< std::setprecision(4) << std::scientific << (*v_vec)(j) << std::endl;
}
ofile.close();
}