source: soft/giet_vm/applications/rosenfeld/nrc2/src/nrlinalg.c

Last change on this file was 823, checked in by meunier, 8 years ago
  • Improved scripts for simulations and graphes
  • Continued to clean up the lib nrc2 (from nrio2x.x to nrmem1.c)
  • Added a version (Fast - Parmerge - No stats)
File size: 2.5 KB
Line 
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) \
28void 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
37transpose_type_matrix(int8_t);
38transpose_type_matrix(uint8_t);
39transpose_type_matrix(int16_t);
40transpose_type_matrix(uint16_t);
41transpose_type_matrix(int32_t);
42transpose_type_matrix(uint32_t);
43transpose_type_matrix(int64_t);
44transpose_type_matrix(uint64_t);
45transpose_type_matrix(float);
46transpose_type_matrix(double);
47transpose_type_matrix(rgb8);
48transpose_type_matrix(rgbx8);
49
50
51#undef transpose1_type_matrix
52#define transpose1_type_matrix(t) \
53void 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
65transpose1_type_matrix(int8_t);
66transpose1_type_matrix(uint8_t);
67transpose1_type_matrix(int16_t);
68transpose1_type_matrix(uint16_t);
69transpose1_type_matrix(int32_t);
70transpose1_type_matrix(uint32_t);
71transpose1_type_matrix(int64_t);
72transpose1_type_matrix(uint64_t);
73transpose1_type_matrix(float);
74transpose1_type_matrix(double);
75transpose1_type_matrix(rgb8);
76transpose1_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
Note: See TracBrowser for help on using the repository browser.