# Fail to compile TMatrixT\<TComplex\>

**URL:** <https://root-forum.cern.ch/t/fail-to-compile-tmatrixt-tcomplex/48232>\
**Category:** ROOT\
**Tags:** root\
**Created:** [December 31, 2021, 2:05pm UTC](https://root-forum.cern.ch/t/fail-to-compile-tmatrixt-tcomplex/48232 "2021-12-31T14:05:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![biden](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a6a055/32.png) [@biden](https://root-forum.cern.ch/u/biden)\
**Post date:** [December 31, 2021, 2:05pm UTC](https://root-forum.cern.ch/t/fail-to-compile-tmatrixt-tcomplex/48232/1 "2021-12-31T14:05:11Z")

</div>

#include \<TMatrixT.h\>  
#include \<TComplex.h\>  
typedef TMatrixT\<TComplex\> TMatC;

int main()  
{  
TMatC mat;  
return 0;  
}

then complie:  
: g++ $(root-config --cflags) $(root-config --libs) test.cxx -o test  
got lots of undefined symbols during link.

any solutions ? thank you.

\_ROOT Version: 6.24/06  
\_Platform: ubuntu 20.40 LTS  
\_Compiler: gcc 9.3.0

---

<div class="post-metadata">

**Author:** ![Eddy\_Offermann](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eddy_offermann/32/25079_2.png) [@Eddy\_Offermann](https://root-forum.cern.ch/u/Eddy_Offermann)\
**Post date:** [January 1, 2022, 9:27am UTC](https://root-forum.cern.ch/t/fail-to-compile-tmatrixt-tcomplex/48232/2 "2022-01-01T09:27:44Z")

</div>

You are getting a lot of messages like

```auto
"TMatrixTBase<TComplex>::NormByDiag(TVectorT<TComplex> const&, char const*)", referenced from:
      vtable for TMatrixT<TComplex> in complex_C_ACLiC_dict.o

```

You will also have to update the file

```auto
root-6.24.06/math/matrix/inc/LinkDef.h

```

for the interpreter.

But more important than being able to compile/link the code, are you sure that  
the matrix decomposition classes (used for matrix inversions) are ready for  
complex number algebra ?

---

<div class="post-metadata">

**Author:** ![biden](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a6a055/32.png) [@biden](https://root-forum.cern.ch/u/biden)\
**Post date:** [January 1, 2022, 9:42am UTC](https://root-forum.cern.ch/t/fail-to-compile-tmatrixt-tcomplex/48232/3 "2022-01-01T09:42:12Z")

</div>

Thanks for your reply. I am not sure current ROOT version support complex algebra. I just want to have a try, in case of failure maybe switching to the third party Eigen is needed.

regards.

---

<div class="post-metadata">

**Author:** ![Eddy\_Offermann](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eddy_offermann/32/25079_2.png) [@Eddy\_Offermann](https://root-forum.cern.ch/u/Eddy_Offermann)\
**Post date:** [January 1, 2022, 10:03am UTC](https://root-forum.cern.ch/t/fail-to-compile-tmatrixt-tcomplex/48232/4 "2022-01-01T10:03:42Z")

</div>

The eigen part of the package is not ready for complex numbers, just have  
a look at for instance TMatrixDEigen:

```auto
////////////////////////////////////////////////////////////////////////////////
/// Nonsymmetric reduction to Hessenberg form.
/// This is derived from the Algol procedures orthes and ortran, by Martin and Wilkinson,
/// Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
/// Fortran subroutines in EISPACK.

void TMatrixDEigen::MakeHessenBerg(TMatrixD &v,TVectorD &ortho,TMatrixD &H)
{
   Double_t *pV = v.GetMatrixArray();
   Double_t *pO = ortho.GetMatrixArray();
   Double_t *pH = H.GetMatrixArray();

```

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [January 15, 2022, 10:04am UTC](https://root-forum.cern.ch/t/fail-to-compile-tmatrixt-tcomplex/48232/5 "2022-01-15T10:04:06Z")

</div>

Closed on January 15, 2022, 10:04am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
