ifnot_plus (Core Functions)


Import

#include <archr/core/ifnot_plus.h>
#include <archr/core/ifnot_plus.hpp>
import archr.core
atomsLoads('archr')

Synopsis

 float archr_core_ifnot_plus_1f32f32f32(const float i1, const float i2, const float i3);
(1)
 double archr_core_ifnot_plus_1f64f64f64(const double i1, const double i2, const double i3);
(2)
 int8_t archr_core_ifnot_plus_1i8i8i8(const int8_t i1, const int8_t i2, const int8_t i3);
(3)
 int16_t archr_core_ifnot_plus_1i16i16i16(const int16_t i1, const int16_t i2, const int16_t i3);
(4)
 int32_t archr_core_ifnot_plus_1i32i32i32(const int32_t i1, const int32_t i2, const int32_t i3);
(5)
 int64_t archr_core_ifnot_plus_1i64i64i64(const int64_t i1, const int64_t i2, const int64_t i3);
(6)
 uint8_t archr_core_ifnot_plus_1u8u8u8(const uint8_t i1, const uint8_t i2, const uint8_t i3);
(7)
 uint16_t archr_core_ifnot_plus_1u16u16u16(const uint16_t i1, const uint16_t i2, const uint16_t i3);
(8)
 uint32_t archr_core_ifnot_plus_1u32u32u32(const uint32_t i1, const uint32_t i2, const uint32_t i3);
(9)
 uint64_t archr_core_ifnot_plus_1u64u64u64(const uint64_t i1, const uint64_t i2, const uint64_t i3);
(10)
 void archr_core_ifnot_plus_f32f32f32(float *o0, const float *i1, size_t sz, const float *i2, const float *i3);
(11)
 void archr_core_ifnot_plus_f64f64f64(double *o0, const double *i1, size_t sz, const double *i2, const double *i3);
(12)
 void archr_core_ifnot_plus_i8i8i8(int8_t *o0, const int8_t *i1, size_t sz, const int8_t *i2, const int8_t *i3);
(13)
 void archr_core_ifnot_plus_i16i16i16(int16_t *o0, const int16_t *i1, size_t sz, const int16_t *i2, const int16_t *i3);
(14)
 void archr_core_ifnot_plus_i32i32i32(int32_t *o0, const int32_t *i1, size_t sz, const int32_t *i2, const int32_t *i3);
(15)
 void archr_core_ifnot_plus_i64i64i64(int64_t *o0, const int64_t *i1, size_t sz, const int64_t *i2, const int64_t *i3);
(16)
 void archr_core_ifnot_plus_u8u8u8(uint8_t *o0, const uint8_t *i1, size_t sz, const uint8_t *i2, const uint8_t *i3);
(17)
 void archr_core_ifnot_plus_u16u16u16(uint16_t *o0, const uint16_t *i1, size_t sz, const uint16_t *i2, const uint16_t *i3);
(18)
 void archr_core_ifnot_plus_u32u32u32(uint32_t *o0, const uint32_t *i1, size_t sz, const uint32_t *i2, const uint32_t *i3);
(19)
 void archr_core_ifnot_plus_u64u64u64(uint64_t *o0, const uint64_t *i1, size_t sz, const uint64_t *i2, const uint64_t *i3);
(20)
 float ifnot_plus(const float i1, const float i2, const float i3);
(1)
 double ifnot_plus(const double i1, const double i2, const double i3);
(2)
 int8_t ifnot_plus(const int8_t i1, const int8_t i2, const int8_t i3);
(3)
 int16_t ifnot_plus(const int16_t i1, const int16_t i2, const int16_t i3);
(4)
 int32_t ifnot_plus(const int32_t i1, const int32_t i2, const int32_t i3);
(5)
 int64_t ifnot_plus(const int64_t i1, const int64_t i2, const int64_t i3);
(6)
 uint8_t ifnot_plus(const uint8_t i1, const uint8_t i2, const uint8_t i3);
(7)
 uint16_t ifnot_plus(const uint16_t i1, const uint16_t i2, const uint16_t i3);
(8)
 uint32_t ifnot_plus(const uint32_t i1, const uint32_t i2, const uint32_t i3);
(9)
 uint64_t ifnot_plus(const uint64_t i1, const uint64_t i2, const uint64_t i3);
(10)
 void ifnot_plus(const float *i1, size_t sz, const float *i2, const float *i3, float *o0);
(11)
 void ifnot_plus(const double *i1, size_t sz, const double *i2, const double *i3, double *o0);
(12)
 void ifnot_plus(const int8_t *i1, size_t sz, const int8_t *i2, const int8_t *i3, int8_t *o0);
(13)
 void ifnot_plus(const int16_t *i1, size_t sz, const int16_t *i2, const int16_t *i3, int16_t *o0);
(14)
 void ifnot_plus(const int32_t *i1, size_t sz, const int32_t *i2, const int32_t *i3, int32_t *o0);
(15)
 void ifnot_plus(const int64_t *i1, size_t sz, const int64_t *i2, const int64_t *i3, int64_t *o0);
(16)
 void ifnot_plus(const uint8_t *i1, size_t sz, const uint8_t *i2, const uint8_t *i3, uint8_t *o0);
(17)
 void ifnot_plus(const uint16_t *i1, size_t sz, const uint16_t *i2, const uint16_t *i3, uint16_t *o0);
(18)
 void ifnot_plus(const uint32_t *i1, size_t sz, const uint32_t *i2, const uint32_t *i3, uint32_t *o0);
(19)
 void ifnot_plus(const uint64_t *i1, size_t sz, const uint64_t *i2, const uint64_t *i3, uint64_t *o0);
(20)
template <typename Range> void ifnot_plus(const Range& i1, const Range& i2, const Range& i3, Range& o0);
(21)
subroutine archr_core_ifnot_plus_1f32f32f32(real(4) :: r, real(4), parameter :: i1, real(4), parameter :: i2, real(4), parameter :: i3)
(1)
subroutine archr_core_ifnot_plus_1f64f64f64(real(8) :: r, real(8), parameter :: i1, real(8), parameter :: i2, real(8), parameter :: i3)
(2)
subroutine archr_core_ifnot_plus_1i8i8i8(integer(1) :: r, integer(1), parameter :: i1, integer(1), parameter :: i2, integer(1), parameter :: i3)
(3)
subroutine archr_core_ifnot_plus_1i16i16i16(integer(2) :: r, integer(2), parameter :: i1, integer(2), parameter :: i2, integer(2), parameter :: i3)
(4)
subroutine archr_core_ifnot_plus_1i32i32i32(integer(4) :: r, integer(4), parameter :: i1, integer(4), parameter :: i2, integer(4), parameter :: i3)
(5)
subroutine archr_core_ifnot_plus_1i64i64i64(integer(8) :: r, integer(8), parameter :: i1, integer(8), parameter :: i2, integer(8), parameter :: i3)
(6)
subroutine archr_core_ifnot_plus_1u8u8u8(integer(1) :: r, integer(1), parameter :: i1, integer(1), parameter :: i2, integer(1), parameter :: i3)
(7)
subroutine archr_core_ifnot_plus_1u16u16u16(integer(2) :: r, integer(2), parameter :: i1, integer(2), parameter :: i2, integer(2), parameter :: i3)
(8)
subroutine archr_core_ifnot_plus_1u32u32u32(integer(4) :: r, integer(4), parameter :: i1, integer(4), parameter :: i2, integer(4), parameter :: i3)
(9)
subroutine archr_core_ifnot_plus_1u64u64u64(integer(8) :: r, integer(8), parameter :: i1, integer(8), parameter :: i2, integer(8), parameter :: i3)
(10)
subroutine archr_core_ifnot_plus_f32f32f32(real(4), dimension(*), parameter :: i1, integer(4) :: sz, real(4), dimension(*), parameter :: i2, real(4), dimension(*), parameter :: i3, real(4), dimension(*) :: o0)
(11)
subroutine archr_core_ifnot_plus_f64f64f64(real(8), dimension(*), parameter :: i1, integer(4) :: sz, real(8), dimension(*), parameter :: i2, real(8), dimension(*), parameter :: i3, real(8), dimension(*) :: o0)
(12)
subroutine archr_core_ifnot_plus_i8i8i8(integer(1), dimension(*), parameter :: i1, integer(4) :: sz, integer(1), dimension(*), parameter :: i2, integer(1), dimension(*), parameter :: i3, integer(1), dimension(*) :: o0)
(13)
subroutine archr_core_ifnot_plus_i16i16i16(integer(2), dimension(*), parameter :: i1, integer(4) :: sz, integer(2), dimension(*), parameter :: i2, integer(2), dimension(*), parameter :: i3, integer(2), dimension(*) :: o0)
(14)
subroutine archr_core_ifnot_plus_i32i32i32(integer(4), dimension(*), parameter :: i1, integer(4) :: sz, integer(4), dimension(*), parameter :: i2, integer(4), dimension(*), parameter :: i3, integer(4), dimension(*) :: o0)
(15)
subroutine archr_core_ifnot_plus_i64i64i64(integer(8), dimension(*), parameter :: i1, integer(4) :: sz, integer(8), dimension(*), parameter :: i2, integer(8), dimension(*), parameter :: i3, integer(8), dimension(*) :: o0)
(16)
subroutine archr_core_ifnot_plus_u8u8u8(integer(1), dimension(*), parameter :: i1, integer(4) :: sz, integer(1), dimension(*), parameter :: i2, integer(1), dimension(*), parameter :: i3, integer(1), dimension(*) :: o0)
(17)
subroutine archr_core_ifnot_plus_u16u16u16(integer(2), dimension(*), parameter :: i1, integer(4) :: sz, integer(2), dimension(*), parameter :: i2, integer(2), dimension(*), parameter :: i3, integer(2), dimension(*) :: o0)
(18)
subroutine archr_core_ifnot_plus_u32u32u32(integer(4), dimension(*), parameter :: i1, integer(4) :: sz, integer(4), dimension(*), parameter :: i2, integer(4), dimension(*), parameter :: i3, integer(4), dimension(*) :: o0)
(19)
subroutine archr_core_ifnot_plus_u64u64u64(integer(8), dimension(*), parameter :: i1, integer(4) :: sz, integer(8), dimension(*), parameter :: i2, integer(8), dimension(*), parameter :: i3, integer(8), dimension(*) :: o0)
(20)
def ifnot_plus(i1, i2, i3):
    return o0
(1)
function o0 = archr_core_ifnot_plus(i1, i2, i3)
(1)

Description

Computes the ifnot_plus:

Parameters

i1_first, i1_last

The first range of input elements

i2

The beggining of the the second range of input elements

i3

The beggining of the the third range of input elements

o0

The beginning of the destination range, may be equal to i1 or i2

i1, i2, i3

The scalar/contiguous data input elements

Example


#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include <archr/core/ifnot_plus.h>

double rand_in(double min, double max) {
  return min + ((double)(max - min) * ((double)rand() / RAND_MAX));
}

int main() {
  time_t t;
  size_t i;
  size_t sz = 10;
  int32_t* i1 = (int32_t*)malloc(sz * sizeof(int32_t));
  int32_t* i2 = (int32_t*)malloc(sz * sizeof(int32_t));
  int32_t* i3 = (int32_t*)malloc(sz * sizeof(int32_t));
  int32_t* o1 = (int32_t*)malloc(sz * sizeof(int32_t));

  srand((unsigned int)time(&t));
  for (i = 0; i < sz; ++i) {
    i1[i] = (int32_t)rand_in((int32_t)-10, (int32_t)10);
  i2[i] = (int32_t)rand_in((int32_t)-10, (int32_t)10);
  i3[i] = (int32_t)rand_in((int32_t)-10, (int32_t)10);
  }
  archr_core_ifnot_plus_i32i32i32(o1, i1, sz, i2, i3);
  for (i = 0; i < sz; ++i) {
    printf("%4lu: ifnot_plus(%d, %d, %d) = %d\n", i, i1[i], i2[i], i3[i], o1[i]);
  }
}

Possible Output

   0: ifnot_plus(9, 1, -3) = 1
   1: ifnot_plus(-7, -5, -8) = -5
   2: ifnot_plus(4, 9, 5) = 9
   3: ifnot_plus(6, 0, -6) = 0
   4: ifnot_plus(1, 0, -2) = 0
   5: ifnot_plus(-9, -3, -9) = -3
   6: ifnot_plus(8, 9, -6) = 9
   7: ifnot_plus(7, -3, 7) = -3
   8: ifnot_plus(0, 0, 6) = 6
   9: ifnot_plus(7, -4, 3) = -4

#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstddef>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <archr/core/ifnot_plus.hpp>

double rand_in(double min, double max) {
  return min + (double(max - min) * (double(std::rand()) / RAND_MAX));
}

int main() {
  std::size_t i;
  std::size_t sz = 10;
  std::vector<std::int32_t> i1(sz);
  std::vector<std::int32_t> i2(sz);
  std::vector<std::int32_t> i3(sz);
  std::vector<std::int32_t> o1(sz);

  std::srand(std::time(0));
  std::generate(i1.begin(), i1.end(), []() { return rand_in(std::int32_t(-10), std::int32_t(10)); });
  std::generate(i2.begin(), i2.end(), []() { return rand_in(std::int32_t(-10), std::int32_t(10)); });
  std::generate(i3.begin(), i3.end(), []() { return rand_in(std::int32_t(-10), std::int32_t(10)); });
  archr::core::ifnot_plus(i1.data(), sz, i2.data(), i3.data(), o1.data());
  for (i = 0; i < sz; ++i) {
    std::cout << std::setw(4) << i << ": " << "ifnot_plus" << "(" << i1[i] << ", " << i2[i] << ", " << i3[i] << ")" << " = " << o1[i] << std::endl;
  }
}

Possible Output

   0: ifnot_plus(-3, 9, -5) = 9
   1: ifnot_plus(0, -3, -6) = -9
   2: ifnot_plus(2, 0, 0) = 0
   3: ifnot_plus(8, -8, -5) = -8
   4: ifnot_plus(-6, 6, 3) = 6
   5: ifnot_plus(-3, 0, 8) = 0
   6: ifnot_plus(-7, 0, 0) = 0
   7: ifnot_plus(-4, -4, -8) = -4
   8: ifnot_plus(-8, 2, 6) = 2
   9: ifnot_plus(-2, 2, -1) = 2

program main
  integer(4), parameter  :: sz = 10
  integer(4), dimension(sz) :: o0
  integer(4), dimension(sz) :: i0
  integer(4), dimension(sz) :: i1
  integer(4), dimension(sz) :: i2
  real(8)                :: r0, r1
  real(8)                :: min0, max0
  real(8)                :: min1, max1
  real(8)                :: min2, max2
  ! Init:
    min0 = -10
    max0 = 10
    min1 = -10
    max1 = 10
    min2 = -10
    max2 = 10
  do i=1,sz
    r0 = random_in(min0, max0)
    r1 = random_in(min1, max1)
    r2 = random_in(min2, max2)
    i0(i) = int(r0)
    i1(i) = int(r1)
    i2(i) = int(r2)
  end do
  ! Example:
  call archr_core_ifnot_plus_i32i32i32(o0, i0, size(i0), i1, i2)
  ! Output:
  do i=1,sz
    print *, i, ": ", o0(i)
  end do
contains
  ! Generate a random number within a range
  function random_in(mn, mx) result(r)
    real(8) :: r
    real(8), intent(in) :: mn, mx
    r = mn + (rand() * (mx - mn))
  end function random_in
end program

Possible Output

           1 :           -7
           2 :           -5
           3 :            3
           4 :           -2
           5 :           -9
           6 :           -6
           7 :           -8
           8 :            1
           9 :            0
          10 :           -1