# Error transconjugate of complex\[int, int\]

**URL:** <https://community.freefem.org/t/error-transconjugate-of-complex-int-int/4229>\
**Category:** General Discussion\
**Created:** [February 26, 2026, 10:10am UTC](https://community.freefem.org/t/error-transconjugate-of-complex-int-int/4229 "2026-02-26T10:10:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayeulchvne](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/mayeulchvne/32/3585_2.png) [@mayeulchvne](https://community.freefem.org/u/mayeulchvne)\
**Post date:** [February 26, 2026, 10:10am UTC](https://community.freefem.org/t/error-transconjugate-of-complex-int-int/4229/1 "2026-02-26T10:10:36Z")

</div>

Hello everyone,

On my installation of the 4.15 version, the operator ‘ of transposition and conjugation seems to not work on complex[int, int]. However it is doing the correct operation on sparse matrices. See the code below.

Thank you for your help.

Bests,

Mayeul

```auto
int m=5; 

complex[int,int] B(m,m);

for[i,j , bij : B] bij = i + 1i*j;

matrix<complex> Bmat(B);

cout << B << endl;

cout << Bmat << endl;

B = B';

Bmat = Bmat';

cout << B << endl;

cout << Bmat << endl;

```

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 26, 2026, 10:50am UTC](https://community.freefem.org/t/error-transconjugate-of-complex-int-int/4229/2 "2026-02-26T10:50:32Z")

</div>

You are right. However if you introduce an intermediate array B1 you get the correct result:

```auto
int m=5; 

complex[int,int] B(m,m);

for[i,j , bij : B] bij = i + 1i*j;

matrix<complex> Bmat(B);

cout << B << endl;

cout << Bmat << endl;

complex[int,int] B1(m,m);
B1 = B';
B = B1;

Bmat = Bmat';

cout << B << endl;

cout << Bmat << endl;

```

There is probably a bug that occurs when the same array B appears on both sides of the “=”.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 27, 2026, 8:11pm UTC](https://community.freefem.org/t/error-transconjugate-of-complex-int-int/4229/3 "2026-02-27T20:11:16Z")

</div>

This code in `src/fflib/array_tlp.hpp` is wrong when using the same `K[int, int]`.

```C++
  1182	template<class K> KNM<K> * set_mat_t(KNM<K> * a,Transpose<KNM<K> * > b ){
  1183 ConjKNM_<K> tb=b.t->t(); ;
  1184 a->resize(tb.N(),tb.M());// correction mars 2013
  1185 *a=tb;
  1186 return a;}

```

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 28, 2026, 6:02am UTC](https://community.freefem.org/t/error-transconjugate-of-complex-int-int/4229/4 "2026-02-28T06:02:52Z")

</div>

Fixed in the `develop` branch at [Copy array when using the same pointer · FreeFem/FreeFem-sources@2281154 · GitHub](https://github.com/FreeFem/FreeFem-sources/commit/22811543fda0f19a2dcc61338314e30f4e773a54?w=1).
