Changeset 27931


Ignore:
Timestamp:
10/01/23 18:46:54 (18 months ago)
Author:
Mathieu Morlighem
Message:

CHG: added print functions for inverse methods

Location:
issm/trunk-jpl/src/c/shared/Elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp

    r24477 r27931  
    8484        }
    8585}
     86
     87void InversionStatsHeader(int NJ){
     88        _printf0_("\n");
     89        _printf0_("┌────┬─────────────────┬────────────┬────────────────────────\n");
     90        _printf0_("│Iter│  Cost function  │ Grad. norm │  List of contributions \n");
     91        _printf0_("├────┼─────────────────┼────────────┼────────────────────────\n");
     92}
     93void InversionStatsIter(int iter,double J, double Gnorm, double* Jlist, int N){
     94        _printf0_("│"<<setw(3)<<iter<<" │ ");
     95        _printf0_("f(x) = "<<setw(8)<<setprecision(5)<<J<<" │ ");
     96        _printf0_("  "<<setw(8)<<setprecision(3)<<Gnorm<<" │");
     97        for(int i=0;i<N;i++) _printf0_(" "<<setw(10)<<setprecision(5)<<Jlist[i]);
     98        _printf0_("\n");
     99}
     100void InversionStatsFooter(int NJ){
     101        _printf0_("└────┴─────────────────┴────────────┴────────────────────────\n");
     102}
  • issm/trunk-jpl/src/c/shared/Elements/elements.h

    r24060 r27931  
    5959void printsparsity(IssmPDouble* array,int lines,int cols=1);
    6060void printbinary(int n);
     61void InversionStatsHeader(int NJ);
     62void InversionStatsIter(int iter,double J, double Gnorm, double* Jlist, int N);
     63void InversionStatsFooter(int NJ);
    6164#endif //ifndef _SHARED_ELEMENTS_H_
Note: See TracChangeset for help on using the changeset viewer.