Skip to content

Commit

Permalink
reduction matrix R file: inserted the integration part at the end of …
Browse files Browse the repository at this point in the history
…the file (replace file wca_reduction_matrix.txt with the computed matrix and backup the original input to wca_reduction_matrix_not_reconditioned.txt)
  • Loading branch information
CBiasuzzi committed Jul 24, 2018
1 parent d2be651 commit a2f05a5
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,25 @@ colnames(bis_matrice_txt_R)<-c("inj. type","inj. num","var. num","coeff.")

##Output path

export_bis_matrix_PC_equip="./cor_matrice.txt"
#export_bis_matrix_PC_equip="./cor_matrice.txt"

write.table(bis_matrice_txt_R, file = export_bis_matrix_PC_equip, append = FALSE, quote = FALSE, sep = " ", eol = "\n", na = "NaN", dec = ".", row.names = FALSE, col.names = TRUE )
#write.table(bis_matrice_txt_R, file = export_bis_matrix_PC_equip, append = FALSE, quote = FALSE, sep = " ", eol = "\n", na = "NaN", dec = ".", row.names = FALSE, col.names = TRUE )

##
## integration section: rename the initial 'wca_reduction_matrix.txt' to 'wca_reduction_matrix_not_reconditioned.txt'
## and write the reconditioned matrix to 'wca_reduction_matrix.txt' (with the original wca_reduction_matrix.txt header)
##

## backup the input matrice_path file to ./wca_reduction_matrix_not_reconditioned.txt
matrice_not_reconditioned_path = "./wca_reduction_matrix_not_reconditioned.txt"
file.rename(matrice_path, matrice_not_reconditioned_path)

## dump the reconditioned matrix, overwriting matrice_path file
cat("#Reconditioned reduction matrix\n#\"inj. type\" \"inj. num\" \"var. num\" \"coeff.\"\n",file=matrice_path)
write.table(bis_matrice_txt_R, file = matrice_path, append = TRUE, quote = FALSE, sep = " ", eol = "\n", na = "NaN", dec = ".", row.names = FALSE, col.names = FALSE )


## is this file used?
export_cor_matrix_PC_equip="./cor_matrice.csv"

write.table(cor_matrix_PC_equip, export_cor_matrix_PC_equip,append = FALSE, quote = FALSE, sep = " ", na = "NaN", dec = ".", row.names = FALSE, col.names = TRUE,qmethod = "double" )
Expand Down

0 comments on commit a2f05a5

Please sign in to comment.