One important difference to torture is that the question here is whether the agent should impose a certain pain on her-/himself for the sake of others -- not whether the agent may or should impose pain on third parties. To illustrate the relevance of this point: it makes good sense for me to believe both (a) that a person with my sort of income ought to give at least 10 percent of it toward effective poverty relief and (b) that it would be wrong for me (or anyone) to force other people with similar salaries to do so. The analogue to torture would be forcing the potential suicidee to stay alive against her/his will -- and this was not what I was advocating.
Now, do you have a duty to suffer for the sake of others' happiness? I think the answer depends on what is at stake for the others and what is at stake for you. Peter Singer has made a very convincing case for holding that you have a duty to rescue a drowning child from a shallow pond. Here what is at stake is the very survival of the child versus the dirt and unpleasantness of wading into the pond.
In some cases, the duty not to commit suicide is equally compelling. I know some such cases where the lives of several other people were -- foreseeably -- devastated beyond repair. When this is true, suicide would normally seem justifiable only if continued life would be very painful indeed. (Obviously, there is no precise exchange rate here. My point is that suicide is continuous with other cases, such as Singer's, where you might also vary the story to make the rescue progressively less important and/or more burdensome.)
A final point. In thinking about suicide and how it would affect others, one should not treat the various burdens as fixed. Continued life may seem very burdensome, but there are often ways to make it much more interesting and rewarding -- one should explore these opportunities. And there typically also are ways to make one's suicide much easier to bear for one's surviving relatives and friends.