00001 // PC12ParameterTranslator.cpp: implementation of the CPC12ParameterTranslator class. 00002 // 00004 00005 #include "PC12ParameterTranslator.h" 00006 00008 // Construction/Destruction 00010 00011 CPC12ParameterTranslator::CPC12ParameterTranslator() 00012 { 00013 00014 } 00015 00016 CPC12ParameterTranslator::~CPC12ParameterTranslator() 00017 { 00018 00019 } 00020 00021 void CPC12ParameterTranslator::OneToZero(double *p1, int n1, double *p0, int n0) 00022 { 00023 for(int i = 0; i < 28; i++) 00024 { 00025 p0[i] = p1[i]; 00026 } 00027 // try setting MM constants to nonzero values to avoid div. by zero 00028 p0[28] = 0.0; 00029 p0[29] = 1.0; 00030 p0[30] = 0.0; 00031 p0[31] = 1.0; 00032 p0[32] = 0.0; 00033 p0[33] = 1.0; 00034 p0[34] = 0.0; 00035 p0[35] = 1.0; 00036 /* 00037 for(i = 28; i < 36; i++) 00038 { 00039 p0[i] = 0.0; 00040 } 00041 */ 00042 for(i = 28; i < n1; i++) 00043 { 00044 p0[i+8] = p1[i]; 00045 } 00046 } 00047 00048 void CPC12ParameterTranslator::ZeroToOne(double *p0, int n0, double *p1, int n1) 00049 { 00050 for(int i = 0; i < 28; i++) 00051 { 00052 p1[i] = p0[i]; 00053 } 00054 for(i = 28; i < n1; i++) 00055 { 00056 p1[i] = p0[i+8]; 00057 } 00058 }