Konwersja formatu macierzy deal.ii na MarketMatrix
|
1 2 3 4 5 6 7 8 9 10 11 |
MATRIX_FILE="Matrix.dat" RHS_FILE="rhs.dat" SOLUTION_FILE="solution.dat" perl -pi -w -e 's/\((.*?),(.*?)\).(.*)/($1+1)." ".($2+1)." ".$3/e' $MATRIX_FILE lines=`grep -c ^ $MATRIX_FILE` rows=`tail -n 1 $MATRIX_FILE | cut -f1 -d' '` sed -i "1s/^/"$rows" "$rows" "$lines"\n/" $MATRIX_FILE sed -i '1s/^/%%MatrixMarket matrix coordinate real general\n/' $MATRIX_FILE sed -i "1s/^/"$rows"\n/" $SOLUTION_FILE sed -i "1s/^/"$rows"\n/" $RHS_FILE |
