diff --git a/externals/coda-oss/UnitTest/UnitTest.vcxproj b/externals/coda-oss/UnitTest/UnitTest.vcxproj
index 532441cbc7..acd9a5bbee 100644
--- a/externals/coda-oss/UnitTest/UnitTest.vcxproj
+++ b/externals/coda-oss/UnitTest/UnitTest.vcxproj
@@ -321,7 +321,7 @@
true
true
-
+
true
true
diff --git a/externals/coda-oss/UnitTest/UnitTest.vcxproj.filters b/externals/coda-oss/UnitTest/UnitTest.vcxproj.filters
index f4e1f33531..fd73449870 100644
--- a/externals/coda-oss/UnitTest/UnitTest.vcxproj.filters
+++ b/externals/coda-oss/UnitTest/UnitTest.vcxproj.filters
@@ -222,7 +222,7 @@
mt
-
+
types
diff --git a/externals/coda-oss/UnitTest/pch.h b/externals/coda-oss/UnitTest/pch.h
index bd1dff097b..26d745b783 100644
--- a/externals/coda-oss/UnitTest/pch.h
+++ b/externals/coda-oss/UnitTest/pch.h
@@ -53,7 +53,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
diff --git a/externals/coda-oss/UnitTest/types.cpp b/externals/coda-oss/UnitTest/types.cpp
index 9ab942e4ff..3d03155b3f 100644
--- a/externals/coda-oss/UnitTest/types.cpp
+++ b/externals/coda-oss/UnitTest/types.cpp
@@ -15,8 +15,8 @@ TEST_CLASS(test_range_list){ public:
#include "types/unittests/test_range_list.cpp"
};
-TEST_CLASS(test_complex_short){ public:
-#include "types/unittests/test_complex_short.cpp"
+TEST_CLASS(test_complex){ public:
+#include "types/unittests/test_complex.cpp"
};
}
\ No newline at end of file
diff --git a/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj b/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj
index f7cb974a77..5c5a4b7f51 100644
--- a/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj
+++ b/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj
@@ -256,7 +256,7 @@
-
+
diff --git a/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters b/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters
index 9f785622bb..f380d7dcd3 100644
--- a/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters
+++ b/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters
@@ -747,7 +747,7 @@
sys
-
+
types
diff --git a/externals/coda-oss/modules/c++/types/include/types/complex.h b/externals/coda-oss/modules/c++/types/include/types/complex.h
new file mode 100644
index 0000000000..f6051594c7
--- /dev/null
+++ b/externals/coda-oss/modules/c++/types/include/types/complex.h
@@ -0,0 +1,145 @@
+/* =========================================================================
+ * This file is part of types-c++
+ * =========================================================================
+ *
+ * (C) Copyright 2004 - 2014, MDA Information Systems LLC
+ * (C) Copyright 2023, Maxar Technologies, Inc.
+ *
+ * types-c++ 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 Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; If not,
+ * see .
+ *
+ */
+
+#pragma once
+#ifndef CODA_OSS_types_complex_h_INCLUDED_
+#define CODA_OSS_types_complex_h_INCLUDED_
+
+#include
+
+// TODO: remove this once TIntergers are switched to types::details::complex
+// '...': warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning.
+#ifndef _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
+#define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
+#endif
+
+#include
+#include
+
+#include "config/disable_compiler_warnings.h"
+#include "coda_oss/CPlusPlus.h"
+
+namespace types
+{
+namespace details
+{
+/*!
+ * \class complex
+ * \brief Our own implementation of std::complex for SIX and friends.
+ *
+ * `std::complex` is no longer valid C++; provide a (partial) work-around.
+ * See https://en.cppreference.com/w/cpp/numeric/complex for detals.
+ *
+ * SIX (and others) mostly use `std::complex` as a
+ * convenient package for two values; very little "complex math" is done
+ * using integers.
+ */
+template
+struct complex final
+{
+ using value_type = T;
+ static_assert(!std::is_floating_point::value, "Use std::complex for floating-point.");
+ static_assert(std::is_signed::value, "T should be a signed integer.");
+
+ complex(value_type re = 0, value_type im = 0) : z{re, im} {}
+ complex(const complex&) = default;
+ complex& operator=(const complex&) = default;
+ complex(complex&&) = default;
+ complex& operator=(complex&&) = default;
+ ~complex() = default;
+
+ // If someone already has a std::complex, is there any harm in creating ours?
+ complex(const std::complex& z_) : complex(z_.real(), z_.imag()) {}
+
+ value_type real() const
+ {
+ return z[0];
+ }
+ void real(value_type value)
+ {
+ z[0] = value;
+ }
+
+ value_type imag() const
+ {
+ return z[1];
+ }
+ void imag(value_type value)
+ {
+ z[1] = value;
+ }
+
+private:
+ value_type z[2]{0, 0};
+};
+
+CODA_OSS_disable_warning_push
+#ifdef _MSC_VER
+#pragma warning(disable: 4996) // '...': warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning.
+#endif
+
+template
+inline const std::complex& cast(const complex& z)
+{
+ // Getting different results with GCC vs MSVC :-( So just use
+ // std::complex Assume by the time we're actually using C++23 with a
+ // compiler that enforces this restriction, "something" will be different.
+ const void* const pZ_ = &z;
+ return *static_cast*>(pZ_);
+}
+
+CODA_OSS_disable_warning_pop
+
+// https://en.cppreference.com/w/cpp/numeric/complex/abs
+template
+inline auto abs(const complex& z)
+{
+ return abs(cast(z));
+}
+
+}
+
+//// Have the compiler pick between std::complex and details::complex
+//template
+//using complex = std::conditional_t::value, std::complex, details::complex>;
+//static_assert(std::is_same, complex>::value, "should be details::complex");
+template
+using complex = std::complex;
+
+static_assert(std::is_same, complex>::value, "should be std::complex");
+static_assert(sizeof(std::complex) == sizeof(complex), "sizeof(sizeof(std::complex) != sizeof(complex)");
+
+// Convenient aliases
+using zfloat = complex; // std::complex
+using zdouble = complex; // std::complex
+//using zlong_double = complex; // std::complex
+
+// Intentionally using somewhat cumbersome names
+// TODO: switch TIntergers to types::details::complex
+using zint8_t = complex; // details:complex
+using zint16_t = complex; // details:complex
+using zint32_t = complex; // details::complex
+using zint64_t = complex; // details::complex
+}
+
+#endif // CODA_OSS_types_complex_h_INCLUDED_
diff --git a/externals/coda-oss/modules/c++/types/include/types/complex_short.h b/externals/coda-oss/modules/c++/types/include/types/complex_short.h
deleted file mode 100644
index ab747a83f9..0000000000
--- a/externals/coda-oss/modules/c++/types/include/types/complex_short.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* =========================================================================
- * This file is part of types-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- * (C) Copyright 2023, Maxar Technologies, Inc.
- *
- * types-c++ 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 Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#pragma once
-#ifndef CODA_OSS_types_complex_short_h_INCLUDED_
-#define CODA_OSS_types_complex_short_h_INCLUDED_
-
-#include
-
-#include "config/disable_compiler_warnings.h"
-#include "coda_oss/CPlusPlus.h"
-
-namespace types
-{
-namespace details
-{
-/*!
- * \class complex_short
- * \brief std::complex
- *
- * `std::complex` is no longer valid C++; provide a (partial) work-around.
- * See https://en.cppreference.com/w/cpp/numeric/complex for detals.
- */
-struct complex_short final
-{
- using value_type = short;
-
- complex_short(value_type re = 0, value_type im = 0) : z{re, im} {}
- complex_short(const complex_short&) = default;
- complex_short& operator=(const complex_short&) = default;
- complex_short(complex_short&&) = default;
- complex_short& operator=(complex_short&&) = default;
- ~complex_short() = default;
-
- value_type real() const
- {
- return z[0];
- }
- void real(value_type value)
- {
- z[0] = value;
- }
-
- value_type imag() const
- {
- return z[1];
- }
- void imag(value_type value)
- {
- z[1] = value;
- }
-
-private:
- value_type z[2]{0, 0};
-};
-static_assert(sizeof(complex_short) == sizeof(float), "sizeof(complex_short) != sizeof(float)");
-
-CODA_OSS_disable_warning_push
-#ifdef _MSC_VER
-#pragma warning(disable: 4996) // '...': warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning.
-#endif
-
-inline const std::complex& cast(const complex_short& z)
-{
- // Getting different results with GCC vs MSVC :-( So just use
- // std::complex Assume by the time we're actually using C++23 with a
- // compiler that enforces this restriction, "something" will be different.
- const void* const pZ_ = &z;
- return *static_cast*>(pZ_);
-}
-
-CODA_OSS_disable_warning_pop
-
-// https://en.cppreference.com/w/cpp/numeric/complex/abs
-inline auto abs(const complex_short& z)
-{
- return abs(cast(z));
-}
-
-}
-
-#if CODA_OSS_cpp23
- using details::complex_short;
-#else
- // No macro to turn this on/off, want to implement what we need in details::complex_short.
- // But keep in `details` in case somebody wants to uncomment.
- //using complex_short = std::complex; // not valid in C++23
- using details::complex_short;
-
- static_assert(sizeof(std::complex) == sizeof(complex_short), "sizeof(sizeof(std::complex) != sizeof(complex_short)");
-#endif
-}
-
-#endif // CODA_OSS_types_complex_short_h_INCLUDED_
diff --git a/externals/coda-oss/modules/c++/types/unittests/test_complex_short.cpp b/externals/coda-oss/modules/c++/types/unittests/test_complex.cpp
similarity index 72%
rename from externals/coda-oss/modules/c++/types/unittests/test_complex_short.cpp
rename to externals/coda-oss/modules/c++/types/unittests/test_complex.cpp
index 43b870a5f7..6410e48f30 100644
--- a/externals/coda-oss/modules/c++/types/unittests/test_complex_short.cpp
+++ b/externals/coda-oss/modules/c++/types/unittests/test_complex.cpp
@@ -22,7 +22,7 @@
#include "TestCase.h"
-#include
+#include
TEST_CASE(TestCxShort_abs)
{
@@ -37,8 +37,17 @@ TEST_CASE(TestCxShort_abs)
CODA_OSS_disable_warning_pop
const auto expected = abs(cx_short);
- const types::complex_short types_cx_short(real, imag);
- const auto actual = abs(types_cx_short);
+ CODA_OSS_disable_warning_push
+ #ifdef _MSC_VER
+ #pragma warning(disable: 4996) // '...': warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning.
+ #endif
+ const types::zint16_t types_zint16(cx_short);
+ CODA_OSS_disable_warning_pop
+ auto actual = abs(types_zint16);
+ TEST_ASSERT_EQ(actual, expected);
+
+ const types::complex types_cx_int16(cx_short);
+ actual = abs(types_cx_int16);
TEST_ASSERT_EQ(actual, expected);
}
diff --git a/six/modules/c++/cphd/framework.h b/six/modules/c++/cphd/framework.h
index 91b3386d67..b0ff40e149 100644
--- a/six/modules/c++/cphd/framework.h
+++ b/six/modules/c++/cphd/framework.h
@@ -39,9 +39,7 @@
#pragma warning(disable: 6386) // Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written.
#pragma warning(disable: 26812) // The enum type '...' is unscoped. Prefer '...' over '...' (Enum.3).
-// error 4996: '...': warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning.
-#define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
-#include
+#include
#pragma warning(push)
#pragma warning(disable: 4464) // relative include path contains '..'
diff --git a/six/modules/c++/cphd/include/cphd/ByteSwap.h b/six/modules/c++/cphd/include/cphd/ByteSwap.h
index c95403b679..066775bd6a 100644
--- a/six/modules/c++/cphd/include/cphd/ByteSwap.h
+++ b/six/modules/c++/cphd/include/cphd/ByteSwap.h
@@ -24,11 +24,14 @@
#define __CPHD_BYTE_SWAP_H__
#include
-#include
-#include
+#include
#include
+#include
+
+#include "cphd/Types.h"
+
namespace cphd
{
/*
@@ -66,7 +69,7 @@ void byteSwapAndPromote(const void* input,
size_t elementSize,
const types::RowCol& dims,
size_t numThreads,
- std::complex* output);
+ cphd::zfloat* output);
/*
* \func byteSwapAndScale
@@ -92,7 +95,7 @@ void byteSwapAndScale(const void* input,
const types::RowCol& dims,
const double* scaleFactors,
size_t numThreads,
- std::complex* output);
+ cphd::zfloat* output);
}
#endif
diff --git a/six/modules/c++/cphd/include/cphd/CPHDWriter.h b/six/modules/c++/cphd/include/cphd/CPHDWriter.h
index 1341cbb829..67f5cc65bb 100644
--- a/six/modules/c++/cphd/include/cphd/CPHDWriter.h
+++ b/six/modules/c++/cphd/include/cphd/CPHDWriter.h
@@ -27,10 +27,14 @@
#include
#include
-#include
+#include
#include
#include
#include
+
+#include
+
+#include
#include
#include
#include
@@ -114,9 +118,9 @@ struct CPHDWriter final
*
* This only works with valid CPHDWriter data types:
* std:: ubyte* (for compressed data)
- * std::complex
- * std::complex
- * std::complex
+ * cphd::zfloat
+ * chpd::zint16_t
+ * cphd::zint8_t
*
* \param pvpBlock The vector based metadata to write.
* \param widebandData .The wideband data to write to disk
@@ -207,9 +211,9 @@ struct CPHDWriter final
* using this method. This only works with
* valid CPHDWriter data types:
* std:: ubyte* (for compressed data)
- * std::complex
- * std::complex
- * std::complex
+ * cphd::zfloat
+ * chpd::zint16_t
+ * cphd::zint8_t
*
* \param data The data to write to disk.
* \param numElements The number of elements in data. Treat the data
diff --git a/six/modules/c++/cphd/include/cphd/PVPBlock.h b/six/modules/c++/cphd/include/cphd/PVPBlock.h
index 8d6f5ce61a..7981e33123 100644
--- a/six/modules/c++/cphd/include/cphd/PVPBlock.h
+++ b/six/modules/c++/cphd/include/cphd/PVPBlock.h
@@ -23,15 +23,16 @@
#ifndef __CPHD_PVP_BLOCK_H__
#define __CPHD_PVP_BLOCK_H__
+#include
+
#include
#include
-#include
#include
-#include
#include
-
#include
+#include
+
#include
#include
#include
@@ -60,9 +61,9 @@ struct AddedPVP
}
};
template
-struct AddedPVP >
+struct AddedPVP >
{
- std::complex getAddedPVP(const six::Parameter& val) const
+ types::complex getAddedPVP(const six::Parameter& val) const
{
return val.getComplex();
}
diff --git a/six/modules/c++/cphd/include/cphd/Types.h b/six/modules/c++/cphd/include/cphd/Types.h
index 0414f738e4..81873ffcb6 100644
--- a/six/modules/c++/cphd/include/cphd/Types.h
+++ b/six/modules/c++/cphd/include/cphd/Types.h
@@ -19,12 +19,16 @@
* see .
*
*/
-#ifndef __CPHD_TYPES_H__
-#define __CPHD_TYPES_H__
#pragma once
+#ifndef SIX_cphd_Types_h_INCLUDED_
+#define SIX_cphd_Types_h_INCLUDED_
+
+#include
#include
+#include
+
#include
#include
#include
@@ -36,6 +40,14 @@ namespace cphd
{
// Use the same types that SIX uses
+using zfloat = six::zfloat;
+using zdouble = six::zdouble;
+
+using zint8_t = types::zint8_t;
+using zint16_t = types::zint16_t;
+using zint32_t = types::zint32_t;
+using zint64_t = types::zint64_t;
+
typedef six::Vector2 Vector2;
typedef six::Vector3 Vector3;
@@ -86,4 +98,4 @@ typedef six::MatchInformation MatchInformation;
}
-#endif
+#endif // SIX_cphd_Types_h_INCLUDED_
\ No newline at end of file
diff --git a/six/modules/c++/cphd/include/cphd/Wideband.h b/six/modules/c++/cphd/include/cphd/Wideband.h
index 95ca1ed732..9774ffb96b 100644
--- a/six/modules/c++/cphd/include/cphd/Wideband.h
+++ b/six/modules/c++/cphd/include/cphd/Wideband.h
@@ -285,7 +285,7 @@ struct Wideband final
const std::vector& vectorScaleFactors,
size_t numThreads,
const mem::BufferView& scratch,
- const mem::BufferView>& data) const;
+ const mem::BufferView& data) const;
void read(size_t channel,
size_t firstVector,
size_t lastVector,
@@ -294,10 +294,10 @@ struct Wideband final
const std::vector& vectorScaleFactors,
size_t numThreads,
std::span scratch,
- std::span> data) const
+ std::span data) const
{
mem::BufferView scratch_(reinterpret_cast(scratch.data()), scratch.size());
- mem::BufferView> data_(data.data(), data.size());
+ mem::BufferView data_(data.data(), data.size());
read(channel, firstVector, lastVector, firstSample, lastSample, vectorScaleFactors, numThreads,
scratch_, data_);
}
diff --git a/six/modules/c++/cphd/source/ByteSwap.cpp b/six/modules/c++/cphd/source/ByteSwap.cpp
index 4f69666ed6..978e1c98dd 100644
--- a/six/modules/c++/cphd/source/ByteSwap.cpp
+++ b/six/modules/c++/cphd/source/ByteSwap.cpp
@@ -30,6 +30,7 @@
#include
#include
+#include
#include
#include
#include
@@ -62,8 +63,8 @@ struct ByteSwapAndPromoteRunnable final : public sys::Runnable
size_t startRow,
size_t numRows,
size_t numCols,
- std::complex* output) :
- mInput(calc_offset(input, startRow * numCols * sizeof(std::complex))),
+ cphd::zfloat* output) :
+ mInput(calc_offset(input, startRow * numCols * sizeof(types::complex))),
mDims(numRows, numCols),
mOutput(output + startRow * numCols)
{
@@ -76,16 +77,16 @@ struct ByteSwapAndPromoteRunnable final : public sys::Runnable
for (size_t row = 0, inIdx = 0, outIdx = 0; row < mDims.row; ++row)
{
- for (size_t col = 0; col < mDims.col; ++col, inIdx += sizeof(std::complex), ++outIdx)
+ for (size_t col = 0; col < mDims.col; ++col, inIdx += sizeof(types::complex), ++outIdx)
{
// Have to be careful here - can't treat mInput as a
- // std::complex directly in case InT is a float (see
+ // types::complex directly in case InT is a float (see
// explanation in byteSwap() comments)
const auto input = calc_offset(mInput, inIdx);
byteSwap(input, real);
byteSwap(calc_offset(input, sizeof(InT)), imag);
- mOutput[outIdx] = std::complex(real, imag);
+ mOutput[outIdx] = cphd::zfloat(real, imag);
}
}
}
@@ -93,7 +94,7 @@ struct ByteSwapAndPromoteRunnable final : public sys::Runnable
private:
const std::byte* const mInput;
const types::RowCol mDims;
- std::complex* const mOutput;
+ cphd::zfloat* const mOutput;
};
@@ -105,8 +106,8 @@ struct ByteSwapAndScaleRunnable final : public sys::Runnable
size_t numRows,
size_t numCols,
const double* scaleFactors,
- std::complex* output) :
- mInput(calc_offset(input, startRow * numCols * sizeof(std::complex))),
+ cphd::zfloat* output) :
+ mInput(calc_offset(input, startRow * numCols * sizeof(types::complex))),
mDims(numRows, numCols),
mScaleFactors(scaleFactors + startRow),
mOutput(output + startRow * numCols)
@@ -124,16 +125,16 @@ struct ByteSwapAndScaleRunnable final : public sys::Runnable
for (size_t col = 0;
col < mDims.col;
- ++col, inIdx += sizeof(std::complex), ++outIdx)
+ ++col, inIdx += sizeof(types::complex), ++outIdx)
{
// Have to be careful here - can't treat mInput as a
- // std::complex directly in case InT is a float (see
+ // types::complex directly in case InT is a float (see
// explanation in byteSwap() comments)
const auto input = calc_offset(mInput, inIdx);
byteSwap(input, real);
byteSwap(calc_offset(input, sizeof(InT)), imag);
- mOutput[outIdx] = std::complex(
+ mOutput[outIdx] = cphd::zfloat(
static_cast(real * scaleFactor),
static_cast(imag * scaleFactor));
}
@@ -144,14 +145,14 @@ struct ByteSwapAndScaleRunnable final : public sys::Runnable
const std::byte* const mInput;
const types::RowCol mDims;
const double* const mScaleFactors;
- std::complex* const mOutput;
+ cphd::zfloat* const mOutput;
};
template
void byteSwapAndPromote(const void* input,
const types::RowCol& dims,
size_t numThreads,
- std::complex* output)
+ cphd::zfloat* output)
{
if (numThreads <= 1)
{
@@ -187,7 +188,7 @@ void byteSwapAndScale(const void* input,
const types::RowCol& dims,
const double* scaleFactors,
size_t numThreads,
- std::complex* output)
+ cphd::zfloat* output)
{
if (numThreads <= 1)
{
@@ -232,7 +233,7 @@ void byteSwapAndPromote(const void* input,
size_t elementSize,
const types::RowCol& dims,
size_t numThreads,
- std::complex* output)
+ cphd::zfloat* output)
{
switch (elementSize)
{
@@ -256,7 +257,7 @@ void byteSwapAndScale(const void* input,
const types::RowCol& dims,
const double* scaleFactors,
size_t numThreads,
- std::complex* output)
+ cphd::zfloat* output)
{
switch (elementSize)
{
diff --git a/six/modules/c++/cphd/source/CPHDWriter.cpp b/six/modules/c++/cphd/source/CPHDWriter.cpp
index e80946b0e5..4d8ad2d9a4 100644
--- a/six/modules/c++/cphd/source/CPHDWriter.cpp
+++ b/six/modules/c++/cphd/source/CPHDWriter.cpp
@@ -178,34 +178,34 @@ template void CPHDWriter::write(const PVPBlock& pvpBlock,
const std::byte* widebandData,
const std::byte* supportData);
-template void CPHDWriter::write>(
+template void CPHDWriter::write(
const PVPBlock& pvpBlock,
- const std::complex* widebandData,
+ const cphd::zint8_t* widebandData,
const sys::ubyte* supportData);
-template void CPHDWriter::write>(
+template void CPHDWriter::write(
const PVPBlock& pvpBlock,
- const std::complex* widebandData,
+ const cphd::zint16_t* widebandData,
const sys::ubyte* supportData);
-template void CPHDWriter::write>(
+template void CPHDWriter::write(
const PVPBlock& pvpBlock,
- const std::complex* widebandData,
+ const cphd::zfloat* widebandData,
const sys::ubyte* supportData);
-template void CPHDWriter::write>(
+template void CPHDWriter::write(
const PVPBlock& pvpBlock,
- const std::complex* widebandData,
+ const cphd::zint8_t* widebandData,
const std::byte* supportData);
-template void CPHDWriter::write>(
+template void CPHDWriter::write(
const PVPBlock& pvpBlock,
- const std::complex* widebandData,
+ const cphd::zint16_t* widebandData,
const std::byte* supportData);
-template void CPHDWriter::write>(
+template void CPHDWriter::write(
const PVPBlock& pvpBlock,
- const std::complex* widebandData,
+ const cphd::zfloat* widebandData,
const std::byte* supportData);
void CPHDWriter::writeMetadata(const PVPBlock& pvpBlock)
@@ -298,16 +298,16 @@ template void CPHDWriter::writeCPHDData(const std::byte* data,
size_t numElements,
size_t channel);
-template void CPHDWriter::writeCPHDData>(
- const std::complex* data,
+template void CPHDWriter::writeCPHDData(
+ const cphd::zint8_t* data,
size_t numElements,
size_t channel);
-template void CPHDWriter::writeCPHDData>(
- const std::complex* data,
+template void CPHDWriter::writeCPHDData(
+ const cphd::zint16_t* data,
size_t numElements,
size_t channel);
-template void CPHDWriter::writeCPHDData>(
- const std::complex* data, size_t numElements, size_t channel);
+template void CPHDWriter::writeCPHDData(
+ const cphd::zfloat* data, size_t numElements, size_t channel);
}
diff --git a/six/modules/c++/cphd/source/PVPBlock.cpp b/six/modules/c++/cphd/source/PVPBlock.cpp
index 23b8e2dde3..c94677ab5b 100644
--- a/six/modules/c++/cphd/source/PVPBlock.cpp
+++ b/six/modules/c++/cphd/source/PVPBlock.cpp
@@ -257,42 +257,42 @@ void PVPBlock::PVPSet::write(const PVPBlock& pvpBlock, const Pvp& p, const sys::
}
else if (it->second.getFormat() == "CI2")
{
- std::complex val;
+ cphd::zint8_t val;
::setData(input + it->second.getByteOffset(), val);
addedPVP[it->first] = six::Parameter();
addedPVP.find(it->first)->second.setValue(val);
}
else if (it->second.getFormat() == "CI4")
{
- std::complex val;
+ cphd::zint16_t val;
::setData(input + it->second.getByteOffset(), val);
addedPVP[it->first] = six::Parameter();
addedPVP.find(it->first)->second.setValue(val);
}
else if (it->second.getFormat() == "CI8")
{
- std::complex val;
+ cphd::zint32_t val;
::setData(input + it->second.getByteOffset(), val);
addedPVP[it->first] = six::Parameter();
addedPVP.find(it->first)->second.setValue(val);
}
else if (it->second.getFormat() == "CI16")
{
- std::complex val;
+ cphd::zint64_t val;
::setData(input + it->second.getByteOffset(), val);
addedPVP[it->first] = six::Parameter();
addedPVP.find(it->first)->second.setValue(val);
}
else if (it->second.getFormat() == "CF8")
{
- std::complex val;
+ cphd::zfloat val;
::setData(input + it->second.getByteOffset(), val);
addedPVP[it->first] = six::Parameter();
addedPVP.find(it->first)->second.setValue(val);
}
else if (it->second.getFormat() == "CF16")
{
- std::complex val;
+ cphd::zdouble val;
::setData(input + it->second.getByteOffset(), val);
addedPVP[it->first] = six::Parameter();
addedPVP.find(it->first)->second.setValue(val);
diff --git a/six/modules/c++/cphd/source/Wideband.cpp b/six/modules/c++/cphd/source/Wideband.cpp
index c073ece8e2..a2a50d48b6 100644
--- a/six/modules/c++/cphd/source/Wideband.cpp
+++ b/six/modules/c++/cphd/source/Wideband.cpp
@@ -24,14 +24,16 @@
#include
#include
#include
-#include
+#include
-#include
+#include
#include
#include
#include
#include
+#include
+
#include
#include
#include
@@ -46,11 +48,11 @@ template
class PromoteRunnable : public sys::Runnable
{
public:
- PromoteRunnable(const std::complex* input,
+ PromoteRunnable(const types::complex* input,
size_t startRow,
size_t numRows,
size_t numCols,
- std::complex* output) :
+ cphd::zfloat* output) :
mInput(input + startRow * numCols),
mDims(numRows, numCols),
mOutput(output + startRow * numCols)
@@ -63,28 +65,28 @@ class PromoteRunnable : public sys::Runnable
{
for (size_t col = 0; col < mDims.col; ++col, ++idx)
{
- const std::complex& input(mInput[idx]);
- mOutput[idx] = std::complex(input.real(), input.imag());
+ const types::complex& input(mInput[idx]);
+ mOutput[idx] = cphd::zfloat(input.real(), input.imag());
}
}
}
private:
- const std::complex* const mInput;
+ const types::complex* const mInput;
const types::RowCol mDims;
- std::complex* const mOutput;
+ cphd::zfloat* const mOutput;
};
template
class ScaleRunnable : public sys::Runnable
{
public:
- ScaleRunnable(const std::complex* input,
+ ScaleRunnable(const types::complex* input,
size_t startRow,
size_t numRows,
size_t numCols,
const double* scaleFactors,
- std::complex* output) :
+ cphd::zfloat* output) :
mInput(input + startRow * numCols),
mDims(numRows, numCols),
mScaleFactors(scaleFactors + startRow),
@@ -99,29 +101,29 @@ class ScaleRunnable : public sys::Runnable
const double scaleFactor(mScaleFactors[row]);
for (size_t col = 0; col < mDims.col; ++col, ++idx)
{
- const std::complex& input(mInput[idx]);
- mOutput[idx] = std::complex(static_cast(input.real() * scaleFactor),
+ const types::complex& input(mInput[idx]);
+ mOutput[idx] = cphd::zfloat(static_cast(input.real() * scaleFactor),
static_cast(input.imag() * scaleFactor));
}
}
}
private:
- const std::complex* const mInput;
+ const types::complex* const mInput;
const types::RowCol mDims;
const double* const mScaleFactors;
- std::complex* const mOutput;
+ cphd::zfloat* const mOutput;
};
template
void promote(const void* input,
const types::RowCol& dims,
size_t numThreads,
- std::complex* output)
+ cphd::zfloat* output)
{
if (numThreads <= 1)
{
- PromoteRunnable