[6310] | 1 | /*
|
---|
| 2 | * \file Verbosity.cpp:
|
---|
| 3 | * \brief: Manage verbosity levels
|
---|
| 4 | *
|
---|
| 5 | * WARNING: DO NOT MODIFY THIS FILE
|
---|
| 6 | * this file has been automatically generated by Synchronize.sh
|
---|
| 7 | * Please read README for more information
|
---|
| 8 | */
|
---|
[6301] | 9 |
|
---|
[6273] | 10 | /*include*/
|
---|
[6310] | 11 | /*{{{*/
|
---|
[6301] | 12 | #ifdef HAVE_CONFIG_H
|
---|
[9320] | 13 | #include <config.h>
|
---|
[6301] | 14 | #else
|
---|
| 15 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 16 | #endif
|
---|
[6273] | 17 | #include "./Verbosity.h"
|
---|
[6301] | 18 | #include "../../include/macros.h"
|
---|
| 19 | #include "../Exceptions/exceptions.h"
|
---|
| 20 | #ifdef _SERIAL_
|
---|
| 21 | #include <mex.h>
|
---|
| 22 | #endif
|
---|
| 23 | /*}}}*/
|
---|
[6273] | 24 |
|
---|
[6301] | 25 | /*Verbosityt levels*/
|
---|
[6323] | 26 | bool VerboseMProcessor(void){return (GetVerbosityLevel() & 1);} /* 2^0*/
|
---|
| 27 | bool VerboseModule(void){return (GetVerbosityLevel() & 2);} /* 2^1*/
|
---|
| 28 | bool VerboseSolution(void){return (GetVerbosityLevel() & 4);} /* 2^2*/
|
---|
[6317] | 29 | bool VerboseSolver(void){return (GetVerbosityLevel() & 8);} /* 2^3*/
|
---|
[6323] | 30 | bool VerboseConvergence(void){return (GetVerbosityLevel() & 16);} /* 2^4*/
|
---|
| 31 | bool VerboseControl(void){return (GetVerbosityLevel() & 32);} /* 2^5*/
|
---|
| 32 | bool VerboseQmu(void){return (GetVerbosityLevel() & 64);} /* 2^6*/
|
---|
[6273] | 33 |
|
---|
[6301] | 34 | /*Verbosity Setup*/
|
---|
| 35 | static int verbositylevel=-1;
|
---|
[6310] | 36 | /*FUNCTION SetVerbosityLevel {{{*/
|
---|
[6301] | 37 | void SetVerbosityLevel(int level){
|
---|
| 38 |
|
---|
[6412] | 39 | if(level<0) _error_("vebosity level should be a positive integer (user provided %i)",level);
|
---|
[6301] | 40 |
|
---|
| 41 | #ifdef _SERIAL_
|
---|
| 42 |
|
---|
| 43 | mxArray* output=NULL;
|
---|
| 44 | mxArray* input=NULL;
|
---|
| 45 | input=mxCreateDoubleScalar((double)level);
|
---|
| 46 |
|
---|
| 47 | mexCallMATLAB(0,&output,1,&input,"SetVerbosityLevel");
|
---|
| 48 | #else
|
---|
| 49 |
|
---|
| 50 | verbositylevel = level;
|
---|
| 51 |
|
---|
| 52 | #endif
|
---|
| 53 | }/*}}}*/
|
---|
[6310] | 54 | /*FUNCTION GetVerbosityLevel {{{*/
|
---|
[6301] | 55 | int GetVerbosityLevel(void){
|
---|
| 56 | #ifdef _SERIAL_
|
---|
| 57 |
|
---|
| 58 | mxArray* output=NULL;
|
---|
| 59 | mxArray* input=NULL;
|
---|
| 60 | double level;
|
---|
| 61 |
|
---|
| 62 | mexCallMATLAB(1,&output,0,&input,"GetVerbosityLevel");
|
---|
| 63 | level=mxGetScalar(output);
|
---|
| 64 |
|
---|
| 65 | verbositylevel = (int)level;
|
---|
[11417] | 66 | return verbositylevel;
|
---|
[6301] | 67 |
|
---|
| 68 | #else
|
---|
| 69 |
|
---|
[6412] | 70 | _assert_(verbositylevel>=0);
|
---|
[6301] | 71 | return verbositylevel;
|
---|
| 72 |
|
---|
| 73 | #endif
|
---|
| 74 | }/*}}}*/
|
---|