lincomentry.cpp | lincomentry.cpp | |||
---|---|---|---|---|
// (C) 2008-2010 D. V. Wiebe | // Copyright (C) 2008-2010 D. V. Wiebe | |||
// | // | |||
/////////////////////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////////////////////// | |||
// | // | |||
// This file is part of the GetData project. | // This file is part of the GetData project. | |||
// | // | |||
// GetData is free software; you can redistribute it and/or modify it under | // GetData is free software; you can redistribute it and/or modify it under | |||
// the terms of the GNU Lesser General Public License as published by the | // the terms of the GNU Lesser General Public License as published by the | |||
// Free Software Foundation; either version 2.1 of the License, or (at your | // Free Software Foundation; either version 2.1 of the License, or (at your | |||
// option) any later version. | // option) any later version. | |||
// | // | |||
skipping to change at line 34 | skipping to change at line 34 | |||
#undef GETDATA_LEGACY_API | #undef GETDATA_LEGACY_API | |||
#include "getdata/dirfile.h" | #include "getdata/dirfile.h" | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <cstring> | #include <cstring> | |||
using namespace GetData; | using namespace GetData; | |||
LincomEntry::LincomEntry(const char* field_code, int n_fields, | LincomEntry::LincomEntry(const char* field_code, int n_fields, | |||
const char** in_fields, double* m, double* b, int fragment_index) : | const char** in_fields, double* m, double* b, int fragment_index) : | |||
Entry::Entry() | Entry() | |||
{ | { | |||
int i; | int i; | |||
E.field = strdup(field_code); | E.field = strdup(field_code); | |||
E.field_type = GD_LINCOM_ENTRY; | E.field_type = GD_LINCOM_ENTRY; | |||
E.u.lincom.n_fields = n_fields; | E.u.lincom.n_fields = n_fields; | |||
E.fragment_index = fragment_index; | E.fragment_index = fragment_index; | |||
E.comp_scal = 0; | E.comp_scal = 0; | |||
for (i = 0; i < n_fields; ++i) { | for (i = 0; i < n_fields; ++i) { | |||
E.in_fields[i] = strdup(in_fields[i]); | E.in_fields[i] = strdup(in_fields[i]); | |||
E.u.lincom.m[i] = m[i]; | E.u.lincom.m[i] = m[i]; | |||
E.u.lincom.b[i] = b[i]; | E.u.lincom.b[i] = b[i]; | |||
} | } | |||
} | } | |||
LincomEntry::LincomEntry(const char* field_code, int n_fields, | LincomEntry::LincomEntry(const char* field_code, int n_fields, | |||
const char** in_fields, std::complex<double>* cm, std::complex<double>* cb, | const char** in_fields, std::complex<double>* cm, std::complex<double>* cb, | |||
int fragment_index) : Entry::Entry() | int fragment_index) : Entry() | |||
{ | { | |||
int i; | int i; | |||
E.field = strdup(field_code); | E.field = strdup(field_code); | |||
E.field_type = GD_LINCOM_ENTRY; | E.field_type = GD_LINCOM_ENTRY; | |||
E.u.lincom.n_fields = n_fields; | E.u.lincom.n_fields = n_fields; | |||
E.fragment_index = fragment_index; | E.fragment_index = fragment_index; | |||
E.comp_scal = 1; | E.comp_scal = 1; | |||
for (i = 0; i < n_fields; ++i) { | for (i = 0; i < n_fields; ++i) { | |||
E.in_fields[i] = strdup(in_fields[i]); | E.in_fields[i] = strdup(in_fields[i]); | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |