Tailored Rounding

Hi,

I was wondering if there is an operation in GAMS to tailor the rounding function.

For example;

If n-n’<0 then n-n’=o, otherwise, n-n’=1.

Thanks in advance,
Arash


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Arash,

How about trying this line of script:
(n-n’)$(n-n’=0)=1;

Cheers
Mehrdad

On Fri, Jan 30, 2015 at 12:37 PM, Arash Beheshtian wrote:

Hi,

I was wondering if there is an operation in GAMS to tailor the rounding function.

For example;

If n-n’<0 then n-n’=o, otherwise, n-n’=1.

Thanks in advance,
Arash


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Dear Arash

see the round, ceil, and floor functions.

regards;
Hossein

On Fri, Jan 30, 2015 at 9:07 PM, Arash Beheshtian wrote:

Hi,

I was wondering if there is an operation in GAMS to tailor the rounding function.

For example;

If n-n’<0 then n-n’=o, otherwise, n-n’=1.

Thanks in advance,
Arash


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

I do not know whether you mean the “heaviside function” (also named unit step function) or not.
In this case, You can use sign(x) function in GAMS and write 0.5*(1+sign(x)) to obtain the heaviside function.

Regards;

Hossein

On Sat, Jan 31, 2015 at 7:25 PM, Hossein Sharifzadeh wrote:

Dear Arash

see the round, ceil, and floor functions.

regards;
Hossein

On Fri, Jan 30, 2015 at 9:07 PM, Arash Beheshtian wrote:

Hi,

I was wondering if there is an operation in GAMS to tailor the rounding function.

For example;

If n-n’<0 then n-n’=o, otherwise, n-n’=1.

Thanks in advance,
Arash


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.