/*******************************************************************************
* Copyright 2015-2018 Intel Corporation.
*
* This software and the related documents are Intel copyrighted  materials,  and
* your use of  them is  governed by the  express license  under which  they were
* provided to you (License).  Unless the License provides otherwise, you may not
* use, modify, copy, publish, distribute,  disclose or transmit this software or
* the related documents without Intel's prior written permission.
*
* This software and the related documents  are provided as  is,  with no express
* or implied  warranties,  other  than those  that are  expressly stated  in the
* License.
*******************************************************************************/

#include <stdio.h>
#include "ipp.h"

/* Next two defines are created to simplify code reading and understanding */
#define EXIT_MAIN exitLine:                                  /* Label for Exit */
#define check_sts(st) if((st) != ippStsNoErr) goto exitLine; /* Go to Exit if Intel(R) Integrated Primitives (Intel(R) IPP) function returned status different from ippStsNoErr */

int main(void)
{
    IppStatus           status;
    Ipp32f x[8] = {1,2,3,5,6,7,8,9};
    Ipp32fc zero={0,0}, y[6] = {0};
    int i = 0;
    check_sts( status = ippsSet_32fc( zero, y, 6 ) )
    check_sts( status = ippsConjPack_32fc( x, y, 6 ) )
    for (i = 0; i < 6; i++)
    {
        printf("{%.3f %.3f} ",y[i].re,y[i].im);
    }
    printf("\n");
    check_sts( status = ippsSet_32fc( zero, y, 6 ) )
    check_sts( status = ippsConjPack_32fc( x, y, 5 ) )
    for (i = 0; i < 5; i++)
    {
        printf("{%.3f %.3f} ",y[i].re,y[i].im);
    }
    printf("\n");

EXIT_MAIN
    printf("Exit status %d (%s)\n", (int)status, ippGetStatusString(status));
    return (int)status;
}