001/* A operation taking one operand of type complex, and producing a value of 002 type complex. 003 004 This file was automatically generated with a preprocessor, so that 005 similar operations are supported on ints, longs, floats, and complexs. 006 007 Copyright (c) 1998-2014 The Regents of the University of California. 008 All rights reserved. 009 010 Permission is hereby granted, without written agreement and without 011 license or royalty fees, to use, copy, modify, and distribute this 012 software and its documentation for any purpose, provided that the above 013 copyright notice and the following two paragraphs appear in all copies 014 of this software. 015 016 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 017 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 018 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 019 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 020 SUCH DAMAGE. 021 022 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 023 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 024 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 025 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 026 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 027 ENHANCEMENTS, OR MODIFICATIONS. 028 029 PT_COPYRIGHT_VERSION_2 030 COPYRIGHTENDKEY 031 032 */ 033package ptolemy.math.test; 034 035import ptolemy.math.Complex; 036import ptolemy.math.ComplexUnaryOperation; 037 038/** A operation taking one argument of type complex, and producing a value of 039 type complex. This interface attempts to mimic a first-class function of 040 a single variable. 041 042 @author Christopher Hylands 043 @version $Id$ 044 @since Ptolemy II 2.0 045 @Pt.ProposedRating Red (ctsay) 046 @Pt.AcceptedRating Red (ctsay) 047 */ 048public class TestComplexUnaryOperation implements ComplexUnaryOperation { 049 /** Operate on the operand, returning a value of the same type. */ 050 @Override 051 public Complex operate(Complex operand) { 052 return operand.negate(); 053 } 054}