| 1 | /* ------------------ */ |
|---|
| 2 | /* --- nrlinalg.c --- */ |
|---|
| 3 | /* ------------------ */ |
|---|
| 4 | |
|---|
| 5 | /* |
|---|
| 6 | * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved |
|---|
| 7 | * Univ Paris Sud XI, CNRS |
|---|
| 8 | * |
|---|
| 9 | * Distributed under the Boost Software License, Version 1.0 |
|---|
| 10 | * see accompanying file LICENSE.txt or copy it at |
|---|
| 11 | * http://www.boost.org/LICENSE_1_0.txt |
|---|
| 12 | */ |
|---|
| 13 | |
|---|
| 14 | #include <stdio.h> |
|---|
| 15 | #include <stddef.h> |
|---|
| 16 | #include <stdlib.h> |
|---|
| 17 | |
|---|
| 18 | #include "mypredef.h" |
|---|
| 19 | #include "nrtype.h" |
|---|
| 20 | #include "nrdef.h" |
|---|
| 21 | #include "nrmacro.h" |
|---|
| 22 | #include "nrkernel.h" |
|---|
| 23 | |
|---|
| 24 | #include "nrlinalg.h" |
|---|
| 25 | |
|---|
| 26 | #undef transpose_type_matrix |
|---|
| 27 | #define transpose_type_matrix(t) \ |
|---|
| 28 | void short_name(t,transpose_,matrix)(t ** S, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** D) \ |
|---|
| 29 | { \ |
|---|
| 30 | for (int32_t i = nrl; i <= nch; i++) { \ |
|---|
| 31 | for (int32_t j = ncl; j <= nch; j++) { \ |
|---|
| 32 | D[j][i] = S[i][j]; \ |
|---|
| 33 | } \ |
|---|
| 34 | } \ |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | transpose_type_matrix(int8_t); |
|---|
| 38 | transpose_type_matrix(uint8_t); |
|---|
| 39 | transpose_type_matrix(int16_t); |
|---|
| 40 | transpose_type_matrix(uint16_t); |
|---|
| 41 | transpose_type_matrix(int32_t); |
|---|
| 42 | transpose_type_matrix(uint32_t); |
|---|
| 43 | transpose_type_matrix(int64_t); |
|---|
| 44 | transpose_type_matrix(uint64_t); |
|---|
| 45 | transpose_type_matrix(float); |
|---|
| 46 | transpose_type_matrix(double); |
|---|
| 47 | transpose_type_matrix(rgb8); |
|---|
| 48 | transpose_type_matrix(rgbx8); |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | #undef transpose1_type_matrix |
|---|
| 52 | #define transpose1_type_matrix(t) \ |
|---|
| 53 | void short_name(t,transpose1_,matrix)(t ** S, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) \ |
|---|
| 54 | { \ |
|---|
| 55 | t tmp; \ |
|---|
| 56 | for (int32_t i = nrl; i <= nch; i++) { \ |
|---|
| 57 | for (int32_t j = i + 1; j <= nch; j++) { \ |
|---|
| 58 | tmp = S[j][i]; \ |
|---|
| 59 | S[j][i] = S[i][j]; \ |
|---|
| 60 | S[i][j] = tmp; \ |
|---|
| 61 | } \ |
|---|
| 62 | } \ |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | transpose1_type_matrix(int8_t); |
|---|
| 66 | transpose1_type_matrix(uint8_t); |
|---|
| 67 | transpose1_type_matrix(int16_t); |
|---|
| 68 | transpose1_type_matrix(uint16_t); |
|---|
| 69 | transpose1_type_matrix(int32_t); |
|---|
| 70 | transpose1_type_matrix(uint32_t); |
|---|
| 71 | transpose1_type_matrix(int64_t); |
|---|
| 72 | transpose1_type_matrix(uint64_t); |
|---|
| 73 | transpose1_type_matrix(float); |
|---|
| 74 | transpose1_type_matrix(double); |
|---|
| 75 | transpose1_type_matrix(rgb8); |
|---|
| 76 | transpose1_type_matrix(rgbx8); |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | // Local Variables: |
|---|
| 82 | // tab-width: 4 |
|---|
| 83 | // c-basic-offset: 4 |
|---|
| 84 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
|---|
| 85 | // indent-tabs-mode: nil |
|---|
| 86 | // End: |
|---|
| 87 | |
|---|
| 88 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
|---|
| 89 | |
|---|