working version of trsolve, added missing settings_type in container_ref. Still possible to optimize trsolve in swap case.