OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
IntVector_api.cpp File Reference
#include "IntVector.hpp"

Go to the source code of this file.

Macros

#define _FCALL

Functions

void intvector_create_ (std::vector< int > **)
void intvector_delete_ (std::vector< int > **)
void intvector_clear_ (std::vector< int > **)
void intvector_push_back_ (std::vector< int > **, const int *)
void intvector_get_size_ (std::vector< int > **, int *)
void intvector_get_redundant_ (std::vector< int > **, int *, int *, int *)
void intvector_copy_to_ (const std::vector< int > **, int *)
void intvector_copy_from_ (std::vector< int > **, const int *, const int *)
void intvector_find_ (const std::vector< int > **, const int *, int *)
void _FCALL INTVECTOR_CREATE (std::vector< int > **vec_ptr)
void _FCALL INTVECTOR_DELETE (std::vector< int > **vec_ptr)
void _FCALL INTVECTOR_CLEAR (std::vector< int > **vec_ptr)
void _FCALL INTVECTOR_PUSH_BACK (std::vector< int > **vec_ptr, const int *i)
void _FCALL INTVECTOR_GET_SIZE (std::vector< int > **vec_ptr, int *i)
void _FCALL INTVECTOR_GET_REDUNDANT (std::vector< int > **vec_ptr, int *res, int *err, int *card)
void _FCALL INTVECTOR_COPY_TO (const std::vector< int > **vec_ptr, int *res)
void _FCALL INTVECTOR_COPY_FROM (std::vector< int > **vec_ptr, const int *res, const int *size)
void _FCALL INTVECTOR_FIND (const std::vector< int > **vec_ptr, const int *what, int *where)

Macro Definition Documentation

◆ _FCALL

#define _FCALL

Definition at line 25 of file IntVector_api.cpp.

Function Documentation

◆ INTVECTOR_CLEAR()

void _FCALL INTVECTOR_CLEAR ( std::vector< int > ** vec_ptr)

Definition at line 49 of file IntVector_api.cpp.

50 {
51 intvector_clear_(vec_ptr);
52 }
void intvector_clear_(std::vector< int > **)

◆ intvector_clear_()

void intvector_clear_ ( std::vector< int > ** vec_ptr)

Definition at line 91 of file IntVector_api.cpp.

92{
93 (*vec_ptr)->clear();
94}

◆ INTVECTOR_COPY_FROM()

void _FCALL INTVECTOR_COPY_FROM ( std::vector< int > ** vec_ptr,
const int * res,
const int * size )

Definition at line 69 of file IntVector_api.cpp.

70 {
71 intvector_copy_from_(vec_ptr, res, size);
72 }
void intvector_copy_from_(std::vector< int > **, const int *, const int *)

◆ intvector_copy_from_()

void intvector_copy_from_ ( std::vector< int > ** vec_ptr,
const int * res,
const int * size )

Definition at line 127 of file IntVector_api.cpp.

128{
129 (*vec_ptr)->resize(*size);
130 for (int i(0) ; i < *size ; ++i) {
131 (*vec_ptr)->at(i) = res[i];
132 }
133}

◆ INTVECTOR_COPY_TO()

void _FCALL INTVECTOR_COPY_TO ( const std::vector< int > ** vec_ptr,
int * res )

Definition at line 65 of file IntVector_api.cpp.

66 {
67 intvector_copy_to_(vec_ptr, res);
68 }
void intvector_copy_to_(const std::vector< int > **, int *)

◆ intvector_copy_to_()

void intvector_copy_to_ ( const std::vector< int > ** vec_ptr,
int * res )

Definition at line 119 of file IntVector_api.cpp.

120{
121 auto iter = (*vec_ptr)->begin();
122 for ( ; iter != (*vec_ptr)->end() ; ++iter) {
123 (*res++) = *iter;
124 }
125}

◆ INTVECTOR_CREATE()

void _FCALL INTVECTOR_CREATE ( std::vector< int > ** vec_ptr)

Definition at line 41 of file IntVector_api.cpp.

42 {
43 intvector_create_(vec_ptr);
44 }
void intvector_create_(std::vector< int > **)

◆ intvector_create_()

void intvector_create_ ( std::vector< int > ** vec_ptr)

Definition at line 80 of file IntVector_api.cpp.

81{
82 *vec_ptr = new std::vector<int> ();
83}

◆ INTVECTOR_DELETE()

void _FCALL INTVECTOR_DELETE ( std::vector< int > ** vec_ptr)

Definition at line 45 of file IntVector_api.cpp.

46 {
47 intvector_delete_(vec_ptr);
48 }
void intvector_delete_(std::vector< int > **)

◆ intvector_delete_()

void intvector_delete_ ( std::vector< int > ** vec_ptr)

Definition at line 85 of file IntVector_api.cpp.

86{
87 delete(*vec_ptr);
88 *vec_ptr = nullptr;
89}

◆ INTVECTOR_FIND()

void _FCALL INTVECTOR_FIND ( const std::vector< int > ** vec_ptr,
const int * what,
int * where )

Definition at line 73 of file IntVector_api.cpp.

74 {
75 intvector_find_(vec_ptr, what, where);
76 }
void intvector_find_(const std::vector< int > **, const int *, int *)

◆ intvector_find_()

void intvector_find_ ( const std::vector< int > ** vec_ptr,
const int * what,
int * where )

Definition at line 135 of file IntVector_api.cpp.

136{
137 *where = -1;
138 auto iter = std::find((*vec_ptr)->begin(), (*vec_ptr)->end(), *what);
139 if (iter != (*vec_ptr)->end()) {
140 *where = std::distance((*vec_ptr)->begin(), iter) + 1;
141 }
142}

◆ INTVECTOR_GET_REDUNDANT()

void _FCALL INTVECTOR_GET_REDUNDANT ( std::vector< int > ** vec_ptr,
int * res,
int * err,
int * card )

Definition at line 61 of file IntVector_api.cpp.

62 {
63 intvector_get_redundant_(vec_ptr, res, err, card);
64 }
void intvector_get_redundant_(std::vector< int > **, int *, int *, int *)

◆ intvector_get_redundant_()

void intvector_get_redundant_ ( std::vector< int > ** vec_ptr,
int * res,
int * err,
int * card )

Definition at line 106 of file IntVector_api.cpp.

107{
108 auto correct_count = [&vec_ptr,&card](int ii) {return (*card == count((*vec_ptr)->begin(), (*vec_ptr)->end(), ii));};
109 auto iter = find_if((*vec_ptr)->begin(), (*vec_ptr)->end(), correct_count);
110 if (iter != (*vec_ptr)->end()) {
111 *res = *iter;
112 *err = 0;
113 } else {
114 *res = 0;
115 *err = 1;
116 }
117}

◆ INTVECTOR_GET_SIZE()

void _FCALL INTVECTOR_GET_SIZE ( std::vector< int > ** vec_ptr,
int * i )

Definition at line 57 of file IntVector_api.cpp.

58 {
59 intvector_get_size_(vec_ptr, i);
60 }
void intvector_get_size_(std::vector< int > **, int *)

◆ intvector_get_size_()

void intvector_get_size_ ( std::vector< int > ** vec_ptr,
int * i )

Definition at line 101 of file IntVector_api.cpp.

102{
103 *i = (*vec_ptr)->size();
104}

◆ INTVECTOR_PUSH_BACK()

void _FCALL INTVECTOR_PUSH_BACK ( std::vector< int > ** vec_ptr,
const int * i )

Definition at line 53 of file IntVector_api.cpp.

54 {
55 intvector_push_back_(vec_ptr, i);
56 }
void intvector_push_back_(std::vector< int > **, const int *)

◆ intvector_push_back_()

void intvector_push_back_ ( std::vector< int > ** vec_ptr,
const int * i )

Definition at line 96 of file IntVector_api.cpp.

97{
98 (*vec_ptr)->push_back(*i);
99}