EqdifSim::EqdifSim(Matrix NumdIn, Matrix DendIn, float Time) { this->Numd = NumdIn; this->Dend = DendIn; this->SampleTime = Time; tf2ssd(); d2c(); ss2tfc(); this->typeModel = "TFDiscrete"; }
char * changement_de_base(int nb, int base) { int i = 0; char * c = malloc(sizeof(char) * NB_OCTETS + 1); for(i = 0 ; i < NB_OCTETS ; i++) { c[NB_OCTETS - 1 - i] = d2c(nb%base); nb = nb/base; } c[NB_OCTETS] = '\0'; return c; }
EqdifSim<UsedType>::EqdifSim(Matrix<UsedType> AdIn, Matrix<UsedType> BdIn, Matrix<UsedType> CdIn, Matrix<UsedType> DdIn, float Time) { this->Ad = AdIn; this->Bd = BdIn; this->Cd = CdIn; this->Dd = DdIn; ss2tfd(); d2c(); tf2ssc(); this->SampleTime = Time; this->typeModel = "SSDiscrete"; }
int main(int argc, char * argv[]) { printf("changement_de_base(8,8) : %s \n", changement_de_base(8,8)); printf("changement_de_base(192,2) : %s \n", changement_de_base(192,2)); printf("changement_de_base(192,8) : %s \n", changement_de_base(192,8)); printf("changement_de_base(192,16) : %s \n", changement_de_base(192,16)); printf("changement_de_base(192,28) : %s \n", changement_de_base(192,28)); printf("d2c(5) : %c\n", d2c(5)); printf("val_max_int() : %d\n", val_max_int()); printf("val_max_uint() : %d\n", val_max_uint()); //printf("entier signé : %ld non signé : %ld\n", sizeof(int), sizeof(unsigned int)); return EXIT_SUCCESS; }
EqdifSim<UsedType>::EqdifSim(Matrix<UsedType> NumdIn, Matrix<UsedType> DendIn, float Time) { this->DiscreteTransferFunction = new Polynom<UsedType>*[1]; for(int i = 0; i < 1; i++) this->DiscreteTransferFunction[i] = new Polynom<UsedType>[1]; this->DiscreteTransferFunction[0][0] = Polynom<UsedType>(NumdIn, DendIn); this->SampleTime = Time; tf2ssd(); d2c(); ss2tfc(); this->typeModel = "TFDiscrete"; }
void basen(uint8_t entier, uint8_t base) { int i; int table[8]; for(i=1;i<=8;i++){ table[i-1]=(entier%base); entier/=base; } for(i=7;i>=0;i--){ if(table[i]>9) printf("%c",d2c(table[i])); else printf("%d",table[i]); } }
void base16(uint8_t entier) { int i; int table[8]; for(i=1;i<=8;i++){ table[i-1]=(entier%16); entier/=16; } for(i=7;i>=0;i--){ if(table[i]>9) printf("%c",d2c(table[i])); else printf("%d",table[i]); } }